it.unimi.dsi.fastutil.shorts
Interface ShortSet

All Superinterfaces:
java.util.Collection<java.lang.Short>, java.lang.Iterable<java.lang.Short>, java.util.Set<java.lang.Short>, ShortCollection, ShortIterable
All Known Subinterfaces:
ShortSortedSet
All Known Implementing Classes:
AbstractShortSet, AbstractShortSortedSet, ShortArraySet, ShortAVLTreeSet, ShortLinkedOpenHashSet, ShortOpenHashSet, ShortRBTreeSet, ShortSets.EmptySet, ShortSets.Singleton, ShortSets.SynchronizedSet, ShortSets.UnmodifiableSet, ShortSortedSets.EmptySet, ShortSortedSets.Singleton, ShortSortedSets.SynchronizedSortedSet, ShortSortedSets.UnmodifiableSortedSet

public interface ShortSet
extends ShortCollection, java.util.Set<java.lang.Short>

A type-specific Set; provides some additional methods that use polymorphism to avoid (un)boxing.

Additionally, this interface strengthens (again) iterator().

See Also:
Set

Method Summary
 ShortIterator iterator()
          Returns a type-specific iterator on the elements of this set.
 boolean remove(short k)
          Removes an element from this set.
 
Methods inherited from interface it.unimi.dsi.fastutil.shorts.ShortCollection
add, addAll, contains, containsAll, rem, removeAll, retainAll, shortIterator, toArray, toArray, toShortArray, toShortArray
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

iterator

ShortIterator iterator()
Returns a type-specific iterator on the elements of this set.

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 Set.

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

remove

boolean remove(short k)
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.

See Also:
Collection.remove(Object)