Package it.unimi.dsi.fastutil.ints
Class IntSets.Singleton
java.lang.Object
java.util.AbstractCollection<Integer>
it.unimi.dsi.fastutil.ints.AbstractIntCollection
it.unimi.dsi.fastutil.ints.AbstractIntSet
it.unimi.dsi.fastutil.ints.IntSets.Singleton
- All Implemented Interfaces:
it.unimi.dsi.fastutil.ints.IntCollection,it.unimi.dsi.fastutil.ints.IntIterable,IntSet,Serializable,Cloneable,Iterable<Integer>,Collection<Integer>,Set<Integer>
- Direct Known Subclasses:
IntSortedSets.Singleton
- Enclosing class:
IntSets
An immutable class representing a type-specific singleton set.
This class may be useful to implement your own in case you subclass a type-specific set.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAll(it.unimi.dsi.fastutil.ints.IntCollection c) booleanaddAll(Collection<? extends Integer> c) clone()booleancontains(int k) voidDeprecated.voidforEach(IntConsumer action) it.unimi.dsi.fastutil.ints.IntListIteratoriterator()Returns a type-specific iterator on the elements of this set.booleanremove(int k) Removes an element from this set.booleanremoveAll(it.unimi.dsi.fastutil.ints.IntCollection c) booleanremoveAll(Collection<?> c) booleanremoveIf(IntPredicate filter) booleanDeprecated.booleanretainAll(it.unimi.dsi.fastutil.ints.IntCollection c) booleanretainAll(Collection<?> c) intsize()it.unimi.dsi.fastutil.ints.IntSpliteratorReturns a type-specific spliterator on the elements of this set.Object[]toArray()Deprecated.int[]Methods inherited from class it.unimi.dsi.fastutil.ints.AbstractIntSet
equals, hashCode, remMethods inherited from class it.unimi.dsi.fastutil.ints.AbstractIntCollection
add, add, contains, containsAll, containsAll, forEach, remove, removeIf, toArray, toIntArray, toStringMethods inherited from class java.util.AbstractCollection
clear, isEmpty, toArrayMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
toArrayMethods inherited from interface it.unimi.dsi.fastutil.ints.IntCollection
add, containsAll, intIterator, intParallelStream, intSpliterator, intStream, parallelStream, removeIf, stream, toArray, toIntArrayMethods inherited from interface it.unimi.dsi.fastutil.ints.IntIterable
forEachMethods inherited from interface java.util.Set
clear, containsAll, isEmpty, toArray
-
Field Details
-
element
protected final int element
-
-
Constructor Details
-
Singleton
protected Singleton(int element)
-
-
Method Details
-
contains
public boolean contains(int k) - Specified by:
containsin interfaceit.unimi.dsi.fastutil.ints.IntCollection- Overrides:
containsin classit.unimi.dsi.fastutil.ints.AbstractIntCollection
-
remove
public boolean remove(int k) Description copied from class:AbstractIntSetRemoves an element from this set. Delegates to the type-specificrem()method implemented by type-specific abstractCollectionsuperclass.- Specified by:
removein interfaceIntSet- Overrides:
removein classAbstractIntSet- See Also:
-
iterator
public it.unimi.dsi.fastutil.ints.IntListIterator iterator()Description copied from interface:IntSetReturns a type-specific iterator on the elements of this set.- Specified by:
iteratorin interfaceCollection<Integer>- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.ints.IntCollection- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.ints.IntIterable- Specified by:
iteratorin interfaceIntSet- Specified by:
iteratorin interfaceIterable<Integer>- Specified by:
iteratorin interfaceSet<Integer>- Specified by:
iteratorin classAbstractIntSet- Returns:
- a type-specific iterator on the elements of this set.
-
spliterator
public it.unimi.dsi.fastutil.ints.IntSpliterator spliterator()Description copied from interface:IntSetReturns a type-specific spliterator on the elements of this set.Set spliterators must report at least
Spliterator.DISTINCT.See
Set.spliterator()for more documentation on the requirements of the returned spliterator.- Specified by:
spliteratorin interfaceCollection<Integer>- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.ints.IntCollection- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.ints.IntIterable- Specified by:
spliteratorin interfaceIntSet- Specified by:
spliteratorin interfaceIterable<Integer>- Specified by:
spliteratorin interfaceSet<Integer>- Returns:
-
size
public int size()- Specified by:
sizein interfaceCollection<Integer>- Specified by:
sizein interfaceSet<Integer>- Specified by:
sizein classAbstractCollection<Integer>
-
toIntArray
public int[] toIntArray()- Specified by:
toIntArrayin interfaceit.unimi.dsi.fastutil.ints.IntCollection- Overrides:
toIntArrayin classit.unimi.dsi.fastutil.ints.AbstractIntCollection
-
forEach
Deprecated. -
addAll
-
removeAll
-
retainAll
-
removeIf
Deprecated.- Specified by:
removeIfin interfaceCollection<Integer>- Specified by:
removeIfin interfaceit.unimi.dsi.fastutil.ints.IntCollection
-
forEach
- Specified by:
forEachin interfaceit.unimi.dsi.fastutil.ints.IntIterable
-
addAll
public boolean addAll(it.unimi.dsi.fastutil.ints.IntCollection c) - Specified by:
addAllin interfaceit.unimi.dsi.fastutil.ints.IntCollection- Overrides:
addAllin classit.unimi.dsi.fastutil.ints.AbstractIntCollection
-
removeAll
public boolean removeAll(it.unimi.dsi.fastutil.ints.IntCollection c) - Specified by:
removeAllin interfaceit.unimi.dsi.fastutil.ints.IntCollection- Overrides:
removeAllin classit.unimi.dsi.fastutil.ints.AbstractIntCollection
-
retainAll
public boolean retainAll(it.unimi.dsi.fastutil.ints.IntCollection c) - Specified by:
retainAllin interfaceit.unimi.dsi.fastutil.ints.IntCollection- Overrides:
retainAllin classit.unimi.dsi.fastutil.ints.AbstractIntCollection
-
removeIf
- Specified by:
removeIfin interfaceit.unimi.dsi.fastutil.ints.IntCollection
-
toArray
Deprecated.- Specified by:
toArrayin interfaceCollection<Integer>- Specified by:
toArrayin interfaceSet<Integer>- Overrides:
toArrayin classAbstractCollection<Integer>
-
clone
-