public class EnumSet
extends java.lang.Object
static final int
values, including
translating them to and from String
representations. It's
intended for use with relatively small nonnegative int values.Modifier and Type | Class and Description |
---|---|
static class |
EnumSet.EnumItem
Enumeration pair information.
|
Modifier and Type | Field and Description |
---|---|
static int |
VALUE_LIMIT
Maximum
int value supported for enumerations. |
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public static final int VALUE_LIMIT
int
value supported for enumerations.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)public java.lang.String getName(int value)
value
- enumeration valuenull
if not definedpublic java.lang.String getNameChecked(int value)
value
- enumeration valuepublic int getValue(java.lang.String name)
name
- possible enumeration name-1
if not found in enumerationpublic int getValueChecked(java.lang.String name)
name
- enumeration namepublic void checkValue(int value)
value
- public int maxIndex()