Class ShortSets.Singleton

java.lang.Object
java.util.AbstractCollection<Short>
it.unimi.dsi.fastutil.shorts.AbstractShortCollection
it.unimi.dsi.fastutil.shorts.AbstractShortSet
it.unimi.dsi.fastutil.shorts.ShortSets.Singleton
All Implemented Interfaces:
it.unimi.dsi.fastutil.shorts.ShortCollection, it.unimi.dsi.fastutil.shorts.ShortIterable, ShortSet, Serializable, Cloneable, Iterable<Short>, Collection<Short>, Set<Short>
Direct Known Subclasses:
ShortSortedSets.Singleton
Enclosing class:
ShortSets

public static class ShortSets.Singleton extends AbstractShortSet 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 short
     
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    boolean
    addAll(it.unimi.dsi.fastutil.shorts.ShortCollection c)
     
    boolean
    addAll(Collection<? extends Short> c)
     
     
    boolean
    contains(short k)
     
    void
    forEach(it.unimi.dsi.fastutil.shorts.ShortConsumer action)
     
    void
    forEach(Consumer<? super Short> action)
    Deprecated.
    it.unimi.dsi.fastutil.ints.IntIterator
     
    it.unimi.dsi.fastutil.ints.IntSpliterator
     
    it.unimi.dsi.fastutil.shorts.ShortListIterator
    Returns a type-specific iterator on the elements of this set.
    boolean
    remove(short k)
    Removes an element from this set.
    boolean
    removeAll(it.unimi.dsi.fastutil.shorts.ShortCollection c)
     
    boolean
     
    boolean
    removeIf(it.unimi.dsi.fastutil.shorts.ShortPredicate filter)
     
    boolean
    removeIf(Predicate<? super Short> filter)
    Deprecated.
    boolean
    retainAll(it.unimi.dsi.fastutil.shorts.ShortCollection c)
     
    boolean
     
    int
     
    it.unimi.dsi.fastutil.shorts.ShortSpliterator
    Returns a type-specific spliterator on the elements of this set.
    Deprecated.
    short[]
     

    Methods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortSet

    equals, hashCode, rem

    Methods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortCollection

    add, add, contains, containsAll, containsAll, remove, toArray, toShortArray, 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 java.util.Set

    clear, containsAll, isEmpty, toArray

    Methods inherited from interface it.unimi.dsi.fastutil.shorts.ShortCollection

    add, containsAll, intParallelStream, intStream, parallelStream, removeIf, stream, toArray, toShortArray

    Methods inherited from interface it.unimi.dsi.fastutil.shorts.ShortIterable

    forEach

    Methods inherited from interface it.unimi.dsi.fastutil.shorts.ShortSet

    add, contains, remove
  • Field Details

    • element

      protected final short element
  • Constructor Details

    • Singleton

      protected Singleton(short element)
  • Method Details

    • contains

      public boolean contains(short k)
      Specified by:
      contains in interface it.unimi.dsi.fastutil.shorts.ShortCollection
      Overrides:
      contains in class it.unimi.dsi.fastutil.shorts.AbstractShortCollection
    • remove

      public boolean remove(short k)
      Description copied from class: AbstractShortSet
      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 ShortSet
      Overrides:
      remove in class AbstractShortSet
      See Also:
    • iterator

      public it.unimi.dsi.fastutil.shorts.ShortListIterator iterator()
      Description copied from interface: ShortSet
      Returns a type-specific iterator on the elements of this set.
      Specified by:
      iterator in interface Collection<Short>
      Specified by:
      iterator in interface Iterable<Short>
      Specified by:
      iterator in interface Set<Short>
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.shorts.ShortCollection
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.shorts.ShortIterable
      Specified by:
      iterator in interface ShortSet
      Specified by:
      iterator in class AbstractShortSet
      Returns:
      a type-specific iterator on the elements of this set.
    • spliterator

      public it.unimi.dsi.fastutil.shorts.ShortSpliterator spliterator()
      Description copied from interface: ShortSet
      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<Short>
      Specified by:
      spliterator in interface Iterable<Short>
      Specified by:
      spliterator in interface Set<Short>
      Specified by:
      spliterator in interface it.unimi.dsi.fastutil.shorts.ShortCollection
      Specified by:
      spliterator in interface it.unimi.dsi.fastutil.shorts.ShortIterable
      Specified by:
      spliterator in interface ShortSet
      Returns:
    • size

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

      public short[] toShortArray()
      Specified by:
      toShortArray in interface it.unimi.dsi.fastutil.shorts.ShortCollection
      Overrides:
      toShortArray in class it.unimi.dsi.fastutil.shorts.AbstractShortCollection
    • forEach

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

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

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

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

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

      public void forEach(it.unimi.dsi.fastutil.shorts.ShortConsumer action)
      Specified by:
      forEach in interface it.unimi.dsi.fastutil.shorts.ShortIterable
    • addAll

      public boolean addAll(it.unimi.dsi.fastutil.shorts.ShortCollection c)
      Specified by:
      addAll in interface it.unimi.dsi.fastutil.shorts.ShortCollection
      Overrides:
      addAll in class it.unimi.dsi.fastutil.shorts.AbstractShortCollection
    • removeAll

      public boolean removeAll(it.unimi.dsi.fastutil.shorts.ShortCollection c)
      Specified by:
      removeAll in interface it.unimi.dsi.fastutil.shorts.ShortCollection
      Overrides:
      removeAll in class it.unimi.dsi.fastutil.shorts.AbstractShortCollection
    • retainAll

      public boolean retainAll(it.unimi.dsi.fastutil.shorts.ShortCollection c)
      Specified by:
      retainAll in interface it.unimi.dsi.fastutil.shorts.ShortCollection
      Overrides:
      retainAll in class it.unimi.dsi.fastutil.shorts.AbstractShortCollection
    • removeIf

      public boolean removeIf(it.unimi.dsi.fastutil.shorts.ShortPredicate filter)
      Specified by:
      removeIf in interface it.unimi.dsi.fastutil.shorts.ShortCollection
    • intIterator

      public it.unimi.dsi.fastutil.ints.IntIterator intIterator()
      Specified by:
      intIterator in interface it.unimi.dsi.fastutil.shorts.ShortCollection
      Specified by:
      intIterator in interface it.unimi.dsi.fastutil.shorts.ShortIterable
    • intSpliterator

      public it.unimi.dsi.fastutil.ints.IntSpliterator intSpliterator()
      Specified by:
      intSpliterator in interface it.unimi.dsi.fastutil.shorts.ShortCollection
      Specified by:
      intSpliterator in interface it.unimi.dsi.fastutil.shorts.ShortIterable
    • toArray

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

      public Object clone()
      Overrides:
      clone in class Object