Package 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
,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, java.util.Set<java.lang.Short>
A type-specificSet
; provides some additional methods that use polymorphism to avoid (un)boxing.Additionally, this interface strengthens (again)
iterator()
.- See Also:
Set
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default boolean
add(java.lang.Short o)
Deprecated.Please use the corresponding type-specific method instead.default boolean
contains(java.lang.Object o)
Deprecated.Please use the corresponding type-specific method instead.ShortIterator
iterator()
Returns a type-specific iterator on the elements of this set.static ShortSet
of(short... a)
Creates a new set using a list of elements.default boolean
rem(short k)
Deprecated.Please useremove()
instead.boolean
remove(short k)
Removes an element from this set.default boolean
remove(java.lang.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, toArray
-
Methods inherited from interface it.unimi.dsi.fastutil.shorts.ShortCollection
add, addAll, contains, containsAll, removeAll, removeIf, removeIf, retainAll, toArray, toShortArray, toShortArray
-
Methods inherited from interface it.unimi.dsi.fastutil.shorts.ShortIterable
forEach, forEach
-
-
-
-
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 extendsSet
.- Specified by:
iterator
in interfacejava.util.Collection<java.lang.Short>
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.Short>
- Specified by:
iterator
in interfacejava.util.Set<java.lang.Short>
- Specified by:
iterator
in interfaceShortCollection
- Specified by:
iterator
in 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 theList
interface.- See Also:
Collection.remove(Object)
-
remove
@Deprecated default boolean remove(java.lang.Object o)
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
remove
in interfacejava.util.Collection<java.lang.Short>
- Specified by:
remove
in interfacejava.util.Set<java.lang.Short>
- Specified by:
remove
in interfaceShortCollection
-
add
@Deprecated default boolean add(java.lang.Short o)
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
add
in interfacejava.util.Collection<java.lang.Short>
- Specified by:
add
in interfacejava.util.Set<java.lang.Short>
- Specified by:
add
in interfaceShortCollection
-
contains
@Deprecated default boolean contains(java.lang.Object o)
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
contains
in interfacejava.util.Collection<java.lang.Short>
- Specified by:
contains
in interfacejava.util.Set<java.lang.Short>
- Specified by:
contains
in interfaceShortCollection
-
rem
@Deprecated default boolean rem(short k)
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:
rem
in interfaceShortCollection
- See Also:
Collection.remove(Object)
-
of
@SafeVarargs static ShortSet of(short... a)
Creates a new set using a list of elements.- Parameters:
a
- a list of elements that will be used to initialize the new set.
-
-