Package edu.wpi.first.units.collections
Class ReadOnlyPrimitiveLongSet
java.lang.Object
edu.wpi.first.units.collections.ReadOnlyPrimitiveLongSet
public class ReadOnlyPrimitiveLongSet extends Object implements Iterable<Long>
A read-only set of unique primitive
long
values.-
Constructor Summary
Constructors Constructor Description ReadOnlyPrimitiveLongSet(long... values)
Creates a new set from the given values. -
Method Summary
Modifier and Type Method Description boolean
contains(long value)
Checks if the set contains a particular value.boolean
isEmpty()
Checks if the set is empty, i.e.Iterator<Long>
iterator()
int
size()
Retrieves the number of elements in the set.LongStream
stream()
Creates a stream of primitive long values for the set.long[]
toArray()
Creates a new array that contains all of the values in the set.
-
Constructor Details
-
ReadOnlyPrimitiveLongSet
Creates a new set from the given values. These values do not have to be unique.- Parameters:
values
- the values that belong to the set.
-
-
Method Details
-
contains
Checks if the set contains a particular value.- Parameters:
value
- the value to check for- Returns:
- true if the value is in the set, false if not
-
size
Retrieves the number of elements in the set.- Returns:
- the number of elements in the set
-
isEmpty
Checks if the set is empty, i.e. contains no values.- Returns:
- true if there are no values in the set, false otherwise.
-
stream
Creates a stream of primitive long values for the set.- Returns:
- a sequential Stream over the elements in this collection
- See Also:
Collection.stream()
-
toArray
Creates a new array that contains all of the values in the set.- Returns:
- an array containing all the values in the set
-
iterator
-