Package jnr.constants
Class ConstantSet
Provides forward and reverse lookup for platform constants
-
Method Summary
Modifier and TypeMethodDescriptionbooleangetConstant(long value) Gets the constant for a value.final ConstantgetConstant(String name) Gets the constant for a name.static ConstantSetgetConstantSet(String name) Gets aConstantSetgetName(int value) Gets the name of a platform constant value.longGets the integer value of a platform constant.iterator()static voidlongmaxValue()Returns the maximum value in this ConstantSetlongminValue()Returns the minimum value in this ConstantSetintsize()Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Method Details
-
getConstantSet
Gets aConstantSet- Parameters:
name- The name of the constant set to get.- Returns:
- A
ConstantSet.
-
getConstant
Gets the constant for a name.- Parameters:
name- The name of the system constant (e.g. "EINVAL").- Returns:
- A
Constantinstance.
-
getConstant
Gets the constant for a value.- Parameters:
value- A system constant value.- Returns:
- A
Constantinstance.
-
getValue
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
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
-
size
public int size()- Specified by:
sizein interfaceCollection<Constant>- Specified by:
sizein interfaceSet<Constant>- Specified by:
sizein classAbstractCollection<Constant>
-
contains
- Specified by:
containsin interfaceCollection<Constant>- Specified by:
containsin interfaceSet<Constant>- Overrides:
containsin classAbstractCollection<Constant>
-
main
-