Class LongSets.Singleton

java.lang.Object
java.util.AbstractCollection<Long>
it.unimi.dsi.fastutil.longs.AbstractLongCollection
it.unimi.dsi.fastutil.longs.AbstractLongSet
it.unimi.dsi.fastutil.longs.LongSets.Singleton
All Implemented Interfaces:
it.unimi.dsi.fastutil.longs.LongCollection, it.unimi.dsi.fastutil.longs.LongIterable, LongSet, Serializable, Cloneable, Iterable<Long>, Collection<Long>, Set<Long>
Direct Known Subclasses:
LongSortedSets.Singleton
Enclosing class:
LongSets

public static class LongSets.Singleton extends AbstractLongSet implements Serializable, Cloneable
An immutable class representing a type-specific singleton set.

This class may be useful to implement your own in case you subclass a type-specific set.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final long
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Singleton(long element)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addAll(it.unimi.dsi.fastutil.longs.LongCollection c)
     
    boolean
    addAll(Collection<? extends Long> c)
     
     
    boolean
    contains(long k)
     
    void
    forEach(Consumer<? super Long> action)
    Deprecated.
    void
     
    it.unimi.dsi.fastutil.longs.LongListIterator
    Returns a type-specific iterator on the elements of this set.
    boolean
    remove(long k)
    Removes an element from this set.
    boolean
    removeAll(it.unimi.dsi.fastutil.longs.LongCollection c)
     
    boolean
     
    boolean
     
    boolean
    removeIf(Predicate<? super Long> filter)
    Deprecated.
    boolean
    retainAll(it.unimi.dsi.fastutil.longs.LongCollection c)
     
    boolean
     
    int
     
    it.unimi.dsi.fastutil.longs.LongSpliterator
    Returns a type-specific spliterator on the elements of this set.
    Deprecated.
    long[]
     

    Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongSet

    equals, hashCode, rem

    Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongCollection

    add, add, contains, containsAll, containsAll, forEach, remove, removeIf, toArray, toLongArray, toString

    Methods inherited from class java.util.AbstractCollection

    clear, isEmpty, toArray

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Collection

    toArray

    Methods inherited from interface it.unimi.dsi.fastutil.longs.LongCollection

    add, containsAll, longIterator, longParallelStream, longSpliterator, longStream, parallelStream, removeIf, stream, toArray, toLongArray

    Methods inherited from interface it.unimi.dsi.fastutil.longs.LongIterable

    forEach

    Methods inherited from interface it.unimi.dsi.fastutil.longs.LongSet

    add, contains, remove

    Methods inherited from interface java.util.Set

    clear, containsAll, isEmpty, toArray
  • Field Details

    • element

      protected final long element
  • Constructor Details

    • Singleton

      protected Singleton(long element)
  • Method Details

    • contains

      public boolean contains(long k)
      Specified by:
      contains in interface it.unimi.dsi.fastutil.longs.LongCollection
      Overrides:
      contains in class it.unimi.dsi.fastutil.longs.AbstractLongCollection
    • remove

      public boolean remove(long k)
      Description copied from class: AbstractLongSet
      Removes an element from this set. Delegates to the type-specific rem() method implemented by type-specific abstract Collection superclass.
      Specified by:
      remove in interface LongSet
      Overrides:
      remove in class AbstractLongSet
      See Also:
    • iterator

      public it.unimi.dsi.fastutil.longs.LongListIterator iterator()
      Description copied from interface: LongSet
      Returns a type-specific iterator on the elements of this set.
      Specified by:
      iterator in interface Collection<Long>
      Specified by:
      iterator in interface Iterable<Long>
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.longs.LongCollection
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.longs.LongIterable
      Specified by:
      iterator in interface LongSet
      Specified by:
      iterator in interface Set<Long>
      Specified by:
      iterator in class AbstractLongSet
      Returns:
      a type-specific iterator on the elements of this set.
    • spliterator

      public it.unimi.dsi.fastutil.longs.LongSpliterator spliterator()
      Description copied from interface: LongSet
      Returns a type-specific spliterator on the elements of this set.

      Set spliterators must report at least Spliterator.DISTINCT.

      See Set.spliterator() for more documentation on the requirements of the returned spliterator.

      Specified by:
      spliterator in interface Collection<Long>
      Specified by:
      spliterator in interface Iterable<Long>
      Specified by:
      spliterator in interface it.unimi.dsi.fastutil.longs.LongCollection
      Specified by:
      spliterator in interface it.unimi.dsi.fastutil.longs.LongIterable
      Specified by:
      spliterator in interface LongSet
      Specified by:
      spliterator in interface Set<Long>
      Returns:
    • size

      public int size()
      Specified by:
      size in interface Collection<Long>
      Specified by:
      size in interface Set<Long>
      Specified by:
      size in class AbstractCollection<Long>
    • toLongArray

      public long[] toLongArray()
      Specified by:
      toLongArray in interface it.unimi.dsi.fastutil.longs.LongCollection
      Overrides:
      toLongArray in class it.unimi.dsi.fastutil.longs.AbstractLongCollection
    • forEach

      @Deprecated public void forEach(Consumer<? super Long> action)
      Deprecated.
      Specified by:
      forEach in interface Iterable<Long>
      Specified by:
      forEach in interface it.unimi.dsi.fastutil.longs.LongIterable
    • addAll

      public boolean addAll(Collection<? extends Long> c)
      Specified by:
      addAll in interface Collection<Long>
      Specified by:
      addAll in interface Set<Long>
      Overrides:
      addAll in class it.unimi.dsi.fastutil.longs.AbstractLongCollection
    • removeAll

      public boolean removeAll(Collection<?> c)
      Specified by:
      removeAll in interface Collection<Long>
      Specified by:
      removeAll in interface Set<Long>
      Overrides:
      removeAll in class it.unimi.dsi.fastutil.longs.AbstractLongCollection
    • retainAll

      public boolean retainAll(Collection<?> c)
      Specified by:
      retainAll in interface Collection<Long>
      Specified by:
      retainAll in interface Set<Long>
      Overrides:
      retainAll in class it.unimi.dsi.fastutil.longs.AbstractLongCollection
    • removeIf

      @Deprecated public boolean removeIf(Predicate<? super Long> filter)
      Deprecated.
      Specified by:
      removeIf in interface Collection<Long>
      Specified by:
      removeIf in interface it.unimi.dsi.fastutil.longs.LongCollection
    • forEach

      public void forEach(LongConsumer action)
      Specified by:
      forEach in interface it.unimi.dsi.fastutil.longs.LongIterable
    • addAll

      public boolean addAll(it.unimi.dsi.fastutil.longs.LongCollection c)
      Specified by:
      addAll in interface it.unimi.dsi.fastutil.longs.LongCollection
      Overrides:
      addAll in class it.unimi.dsi.fastutil.longs.AbstractLongCollection
    • removeAll

      public boolean removeAll(it.unimi.dsi.fastutil.longs.LongCollection c)
      Specified by:
      removeAll in interface it.unimi.dsi.fastutil.longs.LongCollection
      Overrides:
      removeAll in class it.unimi.dsi.fastutil.longs.AbstractLongCollection
    • retainAll

      public boolean retainAll(it.unimi.dsi.fastutil.longs.LongCollection c)
      Specified by:
      retainAll in interface it.unimi.dsi.fastutil.longs.LongCollection
      Overrides:
      retainAll in class it.unimi.dsi.fastutil.longs.AbstractLongCollection
    • removeIf

      public boolean removeIf(LongPredicate filter)
      Specified by:
      removeIf in interface it.unimi.dsi.fastutil.longs.LongCollection
    • toArray

      @Deprecated public Object[] toArray()
      Deprecated.
      Specified by:
      toArray in interface Collection<Long>
      Specified by:
      toArray in interface Set<Long>
      Overrides:
      toArray in class AbstractCollection<Long>
    • clone

      public Object clone()
      Overrides:
      clone in class Object