| java.lang.Object org.jibx.runtime.EnumSet
EnumSet | public class EnumSet (Code) | | Named value set support class. This provides convenience methods to support
working with a set of named static final int values, including
translating them to and from String representations. It's
intended for use with relatively small nonnegative int values.
author: Dennis M. Sosnoski |
Inner Class :public static class EnumItem | |
Field Summary | |
final public static int | VALUE_LIMIT Maximum int value supported for enumerations. |
Constructor Summary | |
public | EnumSet(EnumItem[] items) Constructor from array of enumeration items. | public | EnumSet(int start, String[] names) Constructor from array of names. | public | EnumSet(EnumSet base, int start, String[] names) Constructor from existing enumeration with added names. |
VALUE_LIMIT | final public static int VALUE_LIMIT(Code) | | Maximum int value supported for enumerations.
|
EnumSet | public EnumSet(EnumItem[] items)(Code) | | Constructor from array of enumeration items. The supplied items can be in
any order, and the numeric values do not need to be contiguous (but must
be unique, nonnegative, and should be fairly small). Note that this
constructor will reorder the items in the supplied array as a side
effect.
Parameters: items - array of enumeration items (will be reordered) |
EnumSet | public EnumSet(int start, String[] names)(Code) | | Constructor from array of names. The value associated with each name is
just the position index in the array added to the start value.
Parameters: start - item value for first added name Parameters: names - array of names (no null entries allowed) |
EnumSet | public EnumSet(EnumSet base, int start, String[] names)(Code) | | Constructor from existing enumeration with added names. The value
associated with each name is just the position index in the array added
to the start value.
Parameters: base - base enumeration to be extended Parameters: start - item value for first added name Parameters: names - array of names (no null entries allowed) |
checkValue | public void checkValue(int value)(Code) | | Check value with exception. Throws an exception if the supplied value is
not defined by this enumeration.
Parameters: value - |
getName | public String getName(int value)(Code) | | Get name for value if defined.
Parameters: value - enumeration value name for value, or null if not defined |
getNameChecked | public String getNameChecked(int value)(Code) | | Get name for value. If the supplied value is not defined in the
enumeration this throws an exception.
Parameters: value - enumeration value name for value |
getValue | public int getValue(String name)(Code) | | Get value for name if defined.
Parameters: name - possible enumeration name value for name, or -1 if not found in enumeration |
getValueChecked | public int getValueChecked(String name)(Code) | | Get value for name. If the supplied name is not present in the
enumeration this throws an exception.
Parameters: name - enumeration name value for name |
maxIndex | public int maxIndex()(Code) | | Get maximum index value in enumeration set.
maximum |
|
|