Class sunsoft.jws.visual.rt.type.BaseEnumHelper
All Packages Class Hierarchy This Package Previous Next Index
Class sunsoft.jws.visual.rt.type.BaseEnumHelper
java.lang.Object
|
+----sunsoft.jws.visual.rt.type.BaseEnumHelper
- public class BaseEnumHelper
- extends Object
Keeps track of the string/int pairs in sub-classes of BaseEnum.
This is meant to be a class-wide member for each subclass of
BaseEnum. Each subclass of BaseEnum should provide a single
instance of BaseEnumHelper for use by all instances of that subclass.
- See Also:
- BaseEnum
-
BaseEnumHelper()
-
-
add(int, String)
- Adds a new string/int pair to the internal hashtable.
-
descriptions()
- Returns an array containing all of the String descriptions
available in this enum.
-
elements()
- Returns an Enumeration of the String descriptions
available in this enum.
-
getDefaultChoice()
- Gets the default choice for newly constructed instances of the enum.
-
getInteger(String)
- Returns the Integer associated with a String key.
-
getString(Integer)
- Returns the String associated with an Integer key.
-
isValid(int)
- Returns true if the choice is valid for this enum type.
-
isValid(String)
- Returns true if the choice is valid for this enum type.
-
setDefaultChoice(int)
- Sets the default choice for newly constructed instances of the enum.
BaseEnumHelper
public BaseEnumHelper()
setDefaultChoice
public void setDefaultChoice(int value)
- Sets the default choice for newly constructed instances of the enum.
getDefaultChoice
public int getDefaultChoice()
- Gets the default choice for newly constructed instances of the enum.
add
public void add(int value,
String name)
- Adds a new string/int pair to the internal hashtable.
isValid
public boolean isValid(int choice)
- Returns true if the choice is valid for this enum type.
isValid
public boolean isValid(String choice)
- Returns true if the choice is valid for this enum type.
getInteger
public Integer getInteger(String key)
- Returns the Integer associated with a String key.
getString
public String getString(Integer key)
- Returns the String associated with an Integer key.
elements
public Enumeration elements()
- Returns an Enumeration of the String descriptions
available in this enum.
descriptions
public String[] descriptions()
- Returns an array containing all of the String descriptions
available in this enum.
All Packages Class Hierarchy This Package Previous Next Index