Class ReadOnlyPrimitiveLongSet

java.lang.Object
edu.wpi.first.units.collections.ReadOnlyPrimitiveLongSet
All Implemented Interfaces:
Iterable<Long>

public class ReadOnlyPrimitiveLongSet
extends Object
implements Iterable<Long>
A read-only set of unique primitive long values.
  • Constructor Details

  • Method Details

    • contains

      public boolean contains​(long value)
      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

      public int size()
      Retrieves the number of elements in the set.
      Returns:
      the number of elements in the set
    • isEmpty

      public boolean 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

      public LongStream 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

      public long[] 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

      public Iterator<Long> iterator()
      Specified by:
      iterator in interface Iterable<Long>