Package jnr.constants
Class ConstantSet
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<Constant>
-
- jnr.constants.ConstantSet
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(java.lang.Object o)ConstantgetConstant(long value)Gets the constant for a value.ConstantgetConstant(java.lang.String name)Gets the constant for a name.static ConstantSetgetConstantSet(java.lang.String name)Gets aConstantSetjava.lang.StringgetName(int value)Gets the name of a platform constant value.longgetValue(java.lang.String name)Gets the integer value of a platform constant.java.util.Iterator<Constant>iterator()static voidmain(java.lang.String[] args)longmaxValue()Returns the maximum value in this ConstantSetlongminValue()Returns the minimum value in this ConstantSetintsize()-
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
-
-
-
-
Method Detail
-
getConstantSet
public static ConstantSet getConstantSet(java.lang.String name)
Gets aConstantSet- Parameters:
name- The name of the constant set to get.- Returns:
- A
ConstantSet.
-
getConstant
public final Constant getConstant(java.lang.String name)
Gets the constant for a name.- Parameters:
name- The name of the system constant (e.g. "EINVAL").- Returns:
- A
Constantinstance.
-
getConstant
public Constant getConstant(long value)
Gets the constant for a value.- Parameters:
value- A system constant value.- Returns:
- A
Constantinstance.
-
getValue
public long getValue(java.lang.String name)
Gets the integer value of a platform constant.- Parameters:
name- The name of the platform constant to look up (e.g. "EINVAL").- Returns:
- The integer value of the constant.
-
getName
public java.lang.String getName(int value)
Gets the name of a platform constant value.- Parameters:
value- The integer value to look up.- Returns:
- The name of the constant.
-
minValue
public long minValue()
Returns the minimum value in this ConstantSet- Returns:
- a long value
-
maxValue
public long maxValue()
Returns the maximum value in this ConstantSet- Returns:
- a long value
-
iterator
public java.util.Iterator<Constant> iterator()
-
size
public int size()
-
contains
public boolean contains(java.lang.Object o)
-
main
public static void main(java.lang.String[] args)
-
-