Package edu.wpi.first.units.collections
Class ReadOnlyPrimitiveLongSet
java.lang.Object
edu.wpi.first.units.collections.ReadOnlyPrimitiveLongSet
A read-only set of unique primitive
long
values.-
Constructor Summary
ConstructorDescriptionReadOnlyPrimitiveLongSet
(long... values) Creates a new set from the given values. -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(long value) Checks if the set contains a particular value.boolean
isEmpty()
Checks if the set is empty, i.e.iterator()
int
size()
Retrieves the number of elements in the set.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
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:
-
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
-