Package jnr.constants

# Class ConstantSet

java.lang.Object
java.util.AbstractCollection<Constant>
java.util.AbstractSet<Constant>
jnr.constants.ConstantSet

All Implemented Interfaces:
  `Iterable<Constant>`, `Collection<Constant>`, `Set<Constant>`

public class ConstantSet extends AbstractSet<Constant>
Provides forward and reverse lookup for platform constants

## Method Summary

Modifier and Type
Method
Description
`boolean`
`contains(Object o)`
`Constant`
`getConstant(long value)`
Gets the constant for a value.
`final Constant`
`getConstant(String name)`
Gets the constant for a name.
`static ConstantSet`
`getConstantSet(String name)`
Gets a `ConstantSet`
`String`
`getName(int value)`
Gets the name of a platform constant value.
`long`
`getValue(String name)`
Gets the integer value of a platform constant.
`Iterator<Constant>`
`iterator()`
`static void`
`main(String[] args)`
`long`
`maxValue()`
Returns the maximum value in this ConstantSet
`long`
`minValue()`
Returns the minimum value in this ConstantSet
`int`
`size()`

### Methods inherited from class java.util.AbstractSet

`equals, hashCode, removeAll`

### Methods inherited from class java.util.AbstractCollection

`add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.util.Collection

`parallelStream, removeIf, stream, toArray`

### Methods inherited from interface java.lang.Iterable

`forEach`

### Methods inherited from interface java.util.Set

`add, addAll, clear, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArray`

## Method Details

### getConstantSet

public static ConstantSet getConstantSet(String name)
Gets a `ConstantSet`

Parameters:
  `name` - The name of the constant set to get.
Returns:
  A `ConstantSet`.

### getConstant

public final Constant getConstant(String name)
Gets the constant for a name.

Parameters:
  `name` - The name of the system constant (e.g. "EINVAL").
Returns:
  A `Constant` instance.

### getConstant

public Constant getConstant(long value)
Gets the constant for a value.

Parameters:
  `value` - A system constant value.
Returns:
  A `Constant` instance.

### getValue

public long getValue(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 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 Iterator<Constant> iterator()

Specified by:
  `iterator` in interface `Collection<Constant>`
Specified by:
  `iterator` in interface `Iterable<Constant>`
Specified by:
  `iterator` in interface `Set<Constant>`
Specified by:
  `iterator` in class `AbstractCollection<Constant>`

### size

public int size()

Specified by:
  `size` in interface `Collection<Constant>`
Specified by:
  `size` in interface `Set<Constant>`
Specified by:
  `size` in class `AbstractCollection<Constant>`

### contains

public boolean contains(Object o)

Specified by:
  `contains` in interface `Collection<Constant>`
Specified by:
  `contains` in interface `Set<Constant>`
Overrides:
  `contains` in class `AbstractCollection<Constant>`

### main

public static void main(String[] args)