Modifier and Type | Class and Description |
---|---|
private class |
ConstantSet.ConstantIterator |
Modifier and Type | Field and Description |
---|---|
private static boolean |
CAN_LOAD_RESOURCES |
private java.util.Set<java.lang.Enum> |
constants |
private static java.util.concurrent.ConcurrentMap<java.lang.String,ConstantSet> |
constantSets |
private java.lang.Class<java.lang.Enum> |
enumClass |
private static java.lang.ClassLoader |
LOADER |
private static java.lang.Object |
lock |
private java.lang.Long |
maxValue |
private java.lang.Long |
minValue |
private java.util.Map<java.lang.String,Constant> |
nameToConstant |
private static java.lang.Throwable |
RESOURCE_READ_ERROR |
private java.util.Map<java.lang.Long,Constant> |
valueToConstant |
Modifier | Constructor and Description |
---|---|
private |
ConstantSet(java.lang.Class<java.lang.Enum> enumClass)
Creates a new instance of ConstantSet
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.Object o) |
Constant |
getConstant(long value)
Gets the constant for a value.
|
Constant |
getConstant(java.lang.String name)
Gets the constant for a name.
|
static ConstantSet |
getConstantSet(java.lang.String name)
Gets a ConstantSet
|
private static java.lang.Class<java.lang.Enum> |
getEnumClass(java.lang.String name)
Gets the
Enum class for the constant name space. |
private java.lang.Long |
getLongField(java.lang.String name,
long defaultValue) |
java.lang.String |
getName(int value)
Gets the name of a platform constant value.
|
long |
getValue(java.lang.String name)
Gets the integer value of a platform constant.
|
java.util.Iterator<Constant> |
iterator() |
private static ConstantSet |
loadConstantSet(java.lang.String name) |
static void |
main(java.lang.String[] args) |
long |
maxValue()
Returns the maximum value in this ConstantSet
|
long |
minValue()
Returns the minimum value in this ConstantSet
|
int |
size() |
add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private final java.util.Map<java.lang.String,Constant> nameToConstant
private final java.util.Map<java.lang.Long,Constant> valueToConstant
private final java.util.Set<java.lang.Enum> constants
private final java.lang.Class<java.lang.Enum> enumClass
private volatile java.lang.Long minValue
private volatile java.lang.Long maxValue
private static final java.util.concurrent.ConcurrentMap<java.lang.String,ConstantSet> constantSets
private static final java.lang.Object lock
private static final java.lang.ClassLoader LOADER
private static final boolean CAN_LOAD_RESOURCES
private static volatile java.lang.Throwable RESOURCE_READ_ERROR
private ConstantSet(java.lang.Class<java.lang.Enum> enumClass)
enumClass
- The Enum subclass to load constants from.public static ConstantSet getConstantSet(java.lang.String name)
name
- The name of the constant set to get.private static ConstantSet loadConstantSet(java.lang.String name)
private static final java.lang.Class<java.lang.Enum> getEnumClass(java.lang.String name)
Enum
class for the constant name space.name
- The name of the constants to locate.public final Constant getConstant(java.lang.String name)
name
- The name of the system constant (e.g. "EINVAL").Constant
instance.public Constant getConstant(long value)
value
- A system constant value.Constant
instance.public long getValue(java.lang.String name)
name
- The name of the platform constant to look up (e.g. "EINVAL").public java.lang.String getName(int value)
value
- The integer value to look up.private java.lang.Long getLongField(java.lang.String name, long defaultValue)
public long minValue()
public long maxValue()
public java.util.Iterator<Constant> iterator()
public int size()
public boolean contains(java.lang.Object o)
public static void main(java.lang.String[] args)