Package it.unimi.dsi.fastutil.shorts
Interface ShortSet
- All Superinterfaces:
Collection<Short>,Iterable<Short>,Set<Short>,ShortCollection,ShortIterable
- All Known Subinterfaces:
ShortSortedSet
- All Known Implementing Classes:
AbstractShortSet,AbstractShortSortedSet,ShortArraySet,ShortAVLTreeSet,ShortLinkedOpenCustomHashSet,ShortLinkedOpenHashSet,ShortOpenCustomHashSet,ShortOpenHashSet,ShortRBTreeSet,ShortSets.EmptySet,ShortSets.Singleton,ShortSets.SynchronizedSet,ShortSets.UnmodifiableSet,ShortSortedSets.EmptySet,ShortSortedSets.Singleton,ShortSortedSets.SynchronizedSortedSet,ShortSortedSets.UnmodifiableSortedSet
public interface ShortSet extends ShortCollection, Set<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
Modifier and Type Method Description default booleanadd(Short o)Deprecated.Please use the corresponding type-specific method instead.default booleancontains(Object o)Deprecated.Please use the corresponding type-specific method instead.ShortIteratoriterator()Returns a type-specific iterator on the elements of this set.default booleanrem(short k)Deprecated.Please useremove()instead.booleanremove(short k)Removes an element from this set.default booleanremove(Object o)Deprecated.Please use the corresponding type-specific method instead.Methods inherited from interface java.util.Set
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, size, spliterator, toArray, toArrayMethods inherited from interface it.unimi.dsi.fastutil.shorts.ShortCollection
add, addAll, contains, containsAll, removeAll, removeIf, removeIf, retainAll, toArray, toShortArray, toShortArray
-
Method Details
-
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 extendsSet.- Specified by:
iteratorin interfaceCollection<Short>- Specified by:
iteratorin interfaceIterable<Short>- Specified by:
iteratorin interfaceSet<Short>- Specified by:
iteratorin interfaceShortCollection- Specified by:
iteratorin interfaceShortIterable- Returns:
- a type-specific iterator on the elements of this set.
- See Also:
Iterable.iterator()
-
remove
boolean remove(short k)Removes an element from this set.Note that the corresponding method of a type-specific collection is
rem(). This unfortunate situation is caused by the clash with the similarly named index-based method in theListinterface.- See Also:
Collection.remove(Object)
-
remove
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
removein interfaceCollection<Short>- Specified by:
removein interfaceSet<Short>- Specified by:
removein interfaceShortCollection
-
add
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
addin interfaceCollection<Short>- Specified by:
addin interfaceSet<Short>- Specified by:
addin interfaceShortCollection
-
contains
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
containsin interfaceCollection<Short>- Specified by:
containsin interfaceSet<Short>- Specified by:
containsin interfaceShortCollection
-
rem
Deprecated.Please useremove()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.- Specified by:
remin interfaceShortCollection- See Also:
Collection.remove(Object)
-