|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jibx.runtime.EnumSet
public class EnumSet
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.
Nested Class Summary | |
---|---|
static class |
EnumSet.EnumItem
Enumeration pair information. |
Field Summary | |
---|---|
static int |
VALUE_LIMIT
Maximum int value supported for enumerations. |
Constructor Summary | |
---|---|
EnumSet(EnumSet.EnumItem[] items)
Constructor from array of enumeration items. |
|
EnumSet(EnumSet base,
int start,
java.lang.String[] names)
Constructor from existing enumeration with added names. |
|
EnumSet(int start,
java.lang.String[] names)
Constructor from array of names. |
Method Summary | |
---|---|
void |
checkValue(int value)
Check value with exception. |
java.lang.String |
getName(int value)
Get name for value if defined. |
java.lang.String |
getNameChecked(int value)
Get name for value. |
int |
getValue(java.lang.String name)
Get value for name if defined. |
int |
getValueChecked(java.lang.String name)
Get value for name. |
int |
maxIndex()
Get maximum index value in enumeration set. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int VALUE_LIMIT
int
value supported for enumerations.
Constructor Detail |
---|
public EnumSet(EnumSet.EnumItem[] items)
items
- array of enumeration items (will be reordered)public EnumSet(int start, java.lang.String[] names)
start
- item value for first added namenames
- array of names (no null
entries allowed)public EnumSet(EnumSet base, int start, java.lang.String[] names)
base
- base enumeration to be extendedstart
- item value for first added namenames
- array of names (no null
entries allowed)Method Detail |
---|
public java.lang.String getName(int value)
value
- enumeration value
null
if not definedpublic java.lang.String getNameChecked(int value)
value
- enumeration value
public int getValue(java.lang.String name)
name
- possible enumeration name
-1
if not found in enumerationpublic int getValueChecked(java.lang.String name)
name
- enumeration name
public void checkValue(int value)
value
- public int maxIndex()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |