Class AbstractShortSet

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

public abstract class AbstractShortSet extends it.unimi.dsi.fastutil.shorts.AbstractShortCollection implements Cloneable, ShortSet
An abstract class providing basic methods for sets implementing a type-specific interface.

Note that the type-specific Set interface adds a type-specific remove() method, as it is no longer harmful for subclasses. Thus, concrete subclasses of this class must implement remove() (the rem() implementation of this class just delegates to remove()).

  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
    Returns a hash code for this set.
    abstract it.unimi.dsi.fastutil.shorts.ShortIterator
    Returns a type-specific iterator on the elements of this set.
    boolean
    rem(short k)
    Deprecated.
    Please use remove() instead.
    boolean
    remove(short k)
    Removes an element from this set.

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

    add, add, addAll, addAll, contains, contains, containsAll, containsAll, remove, removeAll, removeAll, retainAll, retainAll, toArray, toShortArray, toShortArray, toString

    Methods inherited from class java.util.AbstractCollection

    clear, isEmpty, size, toArray, toArray

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface java.util.Collection

    toArray

    Methods inherited from interface java.util.Set

    addAll, clear, containsAll, isEmpty, removeAll, retainAll, size, toArray, toArray

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

    add, addAll, contains, containsAll, intIterator, intParallelStream, intSpliterator, intStream, parallelStream, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toShortArray, toShortArray

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

    forEach, forEach, forEach

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

    add, contains, remove, spliterator
  • Constructor Details

    • AbstractShortSet

      protected AbstractShortSet()
  • Method Details

    • iterator

      public abstract it.unimi.dsi.fastutil.shorts.ShortIterator 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 it.unimi.dsi.fastutil.shorts.AbstractShortCollection
      Returns:
      a type-specific iterator on the elements of this set.
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Collection<Short>
      Specified by:
      equals in interface Set<Short>
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Returns a hash code for this set. The hash code of a set is computed by summing the hash codes of its elements.
      Specified by:
      hashCode in interface Collection<Short>
      Specified by:
      hashCode in interface Set<Short>
      Overrides:
      hashCode in class Object
      Returns:
      a hash code for this set.
    • remove

      public boolean remove(short k)
      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
      See Also:
    • rem

      @Deprecated public boolean rem(short k)
      Deprecated.
      Please use remove() instead.
      Removes an element from this set.

      This method is inherited from the type-specific collection this type-specific set is based on, but it should not used as this interface reinstates remove() as removal method. Delegates to the type-specific remove() method specified in the type-specific Set interface.

      Specified by:
      rem in interface it.unimi.dsi.fastutil.shorts.ShortCollection
      Specified by:
      rem in interface ShortSet
      Overrides:
      rem in class it.unimi.dsi.fastutil.shorts.AbstractShortCollection