Class AbstractReferenceSet<K>

java.lang.Object
java.util.AbstractCollection<K>
it.unimi.dsi.fastutil.objects.AbstractReferenceCollection<K>
it.unimi.dsi.fastutil.objects.AbstractReferenceSet<K>
All Implemented Interfaces:
it.unimi.dsi.fastutil.objects.ObjectIterable<K>, it.unimi.dsi.fastutil.objects.ReferenceCollection<K>, ReferenceSet<K>, Cloneable, Iterable<K>, Collection<K>, Set<K>
Direct Known Subclasses:
AbstractReferenceSortedSet, ReferenceArraySet, ReferenceOpenHashBigSet, ReferenceOpenHashSet, ReferenceSets.Singleton

public abstract class AbstractReferenceSet<K> extends it.unimi.dsi.fastutil.objects.AbstractReferenceCollection<K> implements Cloneable, ReferenceSet<K>
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 Details

    • AbstractReferenceSet

      protected AbstractReferenceSet()
  • Method Details

    • iterator

      public abstract it.unimi.dsi.fastutil.objects.ObjectIterator<K> iterator()
      Description copied from interface: ReferenceSet
      Returns a type-specific iterator on the elements of this set.
      Specified by:
      iterator in interface Collection<K>
      Specified by:
      iterator in interface Iterable<K>
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.objects.ObjectIterable<K>
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.objects.ReferenceCollection<K>
      Specified by:
      iterator in interface ReferenceSet<K>
      Specified by:
      iterator in interface Set<K>
      Specified by:
      iterator in class it.unimi.dsi.fastutil.objects.AbstractReferenceCollection<K>
      Returns:
      a type-specific iterator on the elements of this set.
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Collection<K>
      Specified by:
      equals in interface Set<K>
      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<K>
      Specified by:
      hashCode in interface Set<K>
      Overrides:
      hashCode in class Object
      Returns:
      a hash code for this set.