Package it.unimi.dsi.fastutil.ints
Interface IntSet
-
- All Superinterfaces:
java.util.Collection<java.lang.Integer>
,IntCollection
,IntIterable
,java.lang.Iterable<java.lang.Integer>
,java.util.Set<java.lang.Integer>
- All Known Subinterfaces:
IntSortedSet
- All Known Implementing Classes:
AbstractIntSet
,AbstractIntSortedSet
,IntArraySet
,IntAVLTreeSet
,IntLinkedOpenCustomHashSet
,IntLinkedOpenHashSet
,IntOpenCustomHashSet
,IntOpenHashBigSet
,IntOpenHashSet
,IntRBTreeSet
,IntSets.EmptySet
,IntSets.Singleton
,IntSets.SynchronizedSet
,IntSets.UnmodifiableSet
,IntSortedSets.EmptySet
,IntSortedSets.Singleton
,IntSortedSets.SynchronizedSortedSet
,IntSortedSets.UnmodifiableSortedSet
public interface IntSet extends IntCollection, java.util.Set<java.lang.Integer>
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.Integer 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.IntIterator
iterator()
Returns a type-specific iterator on the elements of this set.static IntSet
of(int... a)
Creates a new set using a list of elements.default boolean
rem(int k)
Deprecated.Please useremove()
instead.boolean
remove(int 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 it.unimi.dsi.fastutil.ints.IntCollection
add, addAll, contains, containsAll, removeAll, removeIf, removeIf, retainAll, toArray, toIntArray, toIntArray
-
Methods inherited from interface it.unimi.dsi.fastutil.ints.IntIterable
forEach, forEach
-
-
-
-
Method Detail
-
iterator
IntIterator 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.Integer>
- Specified by:
iterator
in interfaceIntCollection
- Specified by:
iterator
in interfaceIntIterable
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.Integer>
- Specified by:
iterator
in interfacejava.util.Set<java.lang.Integer>
- Returns:
- a type-specific iterator on the elements of this set.
- See Also:
Iterable.iterator()
-
remove
boolean remove(int 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.Integer>
- Specified by:
remove
in interfaceIntCollection
- Specified by:
remove
in interfacejava.util.Set<java.lang.Integer>
-
add
@Deprecated default boolean add(java.lang.Integer o)
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
add
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
add
in interfaceIntCollection
- Specified by:
add
in interfacejava.util.Set<java.lang.Integer>
-
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.Integer>
- Specified by:
contains
in interfaceIntCollection
- Specified by:
contains
in interfacejava.util.Set<java.lang.Integer>
-
rem
@Deprecated default boolean rem(int 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 interfaceIntCollection
- See Also:
Collection.remove(Object)
-
of
@SafeVarargs static IntSet of(int... 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.
-
-