it.unimi.dsi.fastutil.shorts
Class AbstractShortSet

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

public abstract class AbstractShortSet
extends AbstractShortCollection
implements java.lang.Cloneable, ShortSet

An abstract class providing basic methods for sets implementing a type-specific interface.


Method Summary
 boolean equals(java.lang.Object o)
           
 int hashCode()
          Returns a hash code for this set.
abstract  ShortIterator iterator()
          Returns a type-specific iterator on the elements of this collection.
 boolean rem(short k)
          Delegates to remove().
 boolean remove(java.lang.Object o)
          Delegates to the corresponding type-specific method.
 boolean remove(short k)
          Removes an element from this set.
 
Methods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortCollection
add, add, addAll, addAll, clear, contains, containsAll, containsAll, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, shortIterator, toArray, toArray, toArray, toShortArray, toShortArray, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.shorts.ShortCollection
add, addAll, contains, containsAll, removeAll, retainAll, shortIterator, toArray, toArray, toShortArray, toShortArray
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, isEmpty, removeAll, retainAll, size, toArray, toArray
 

Method Detail

iterator

public abstract ShortIterator iterator()
Description copied from interface: ShortCollection
Returns a type-specific iterator on the elements of this collection.

Note that this specification strengthens the one given in Iterable.iterator(), which was already strengthened in the corresponding type-specific class, but was weakened by the fact that this interface extends Collection.

Specified by:
iterator in interface ShortCollection
Specified by:
iterator in interface ShortIterable
Specified by:
iterator in interface ShortSet
Specified by:
iterator in interface java.lang.Iterable<java.lang.Short>
Specified by:
iterator in interface java.util.Collection<java.lang.Short>
Specified by:
iterator in interface java.util.Set<java.lang.Short>
Specified by:
iterator in class AbstractShortCollection
Returns:
a type-specific iterator on the elements of this collection.

equals

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

remove

public boolean remove(short k)
Description copied from interface: ShortSet
Removes an element from this set.

Note that the corresponding method of the type-specific collection is rem(). This unfortunate situation is caused by the clash with the similarly named index-based method in the List interface.

Specified by:
remove in interface ShortSet
See Also:
Collection.remove(Object)

rem

public boolean rem(short k)
Delegates to remove().

Specified by:
rem in interface ShortCollection
Overrides:
rem in class AbstractShortCollection
Parameters:
k - the element to be removed.
Returns:
true if the set was modified.
See Also:
Collection.remove(Object)

remove

public boolean remove(java.lang.Object o)
Delegates to the corresponding type-specific method.

Specified by:
remove in interface java.util.Collection<java.lang.Short>
Specified by:
remove in interface java.util.Set<java.lang.Short>
Overrides:
remove in class AbstractShortCollection