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:
IntCollection,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:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds all elements of the given type-specific collection to this collection.booleanaddAll(Collection<? extends Integer> c) clone()booleancontains(int k) Returnstrueif this collection contains the specified element.voidDeprecated.voidforEach(IntConsumer action) Performs the given action for each element of this type-specificIterableuntil all elements have been processed or the action throws an exception.iterator()Returns a type-specific iterator on the elements of this collection.booleanremove(int k) Removes an element from this set.booleanRemove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c) booleanremoveIf(IntPredicate filter) Remove from this collection all elements which satisfy the given predicate.booleanDeprecated.booleanRetains in this collection only elements from the given type-specific collection.booleanretainAll(Collection<?> c) intsize()Returns a type-specific spliterator on the elements of this collection.Object[]toArray()Deprecated.int[]Returns a primitive type array containing the items of this collection.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 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
-
Method Details
-
contains
public boolean contains(int k) Description copied from class:AbstractIntCollectionReturnstrueif this collection contains the specified element.- Specified by:
containsin interfaceIntCollection- Overrides:
containsin classAbstractIntCollection- See Also:
-
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
Description copied from interface:IntCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfaceCollection<Integer>- Specified by:
iteratorin interfaceIntCollection- Specified by:
iteratorin interfaceIntIterable- 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 collection.
- See Also:
-
spliterator
Description copied from interface:IntCollectionReturns a type-specific spliterator on the elements of this collection.See
Collection.spliterator()for more documentation on the requirements of the returned spliterator.- Specified by:
spliteratorin interfaceCollection<Integer>- Specified by:
spliteratorin interfaceIntCollection- Specified by:
spliteratorin interfaceIntIterable- Specified by:
spliteratorin interfaceIntSet- Specified by:
spliteratorin interfaceIterable<Integer>- Specified by:
spliteratorin interfaceSet<Integer>- Returns:
- a type-specific spliterator on the elements of this collection.
-
size
public int size()- Specified by:
sizein interfaceCollection<Integer>- Specified by:
sizein interfaceSet<Integer>- Specified by:
sizein classAbstractCollection<Integer>
-
toIntArray
public int[] toIntArray()Description copied from interface:IntCollectionReturns a primitive type array containing the items of this collection.- Specified by:
toIntArrayin interfaceIntCollection- Overrides:
toIntArrayin classAbstractIntCollection- Returns:
- a primitive type array containing the items of this collection.
- See Also:
-
forEach
Deprecated.Description copied from interface:IntIterable- Specified by:
forEachin interfaceIntIterable- Specified by:
forEachin interfaceIterable<Integer>
-
addAll
Description copied from class:AbstractIntCollection- Specified by:
addAllin interfaceCollection<Integer>- Specified by:
addAllin interfaceSet<Integer>- Overrides:
addAllin classAbstractIntCollection
-
removeAll
Description copied from class:AbstractIntCollection- Specified by:
removeAllin interfaceCollection<Integer>- Specified by:
removeAllin interfaceSet<Integer>- Overrides:
removeAllin classAbstractIntCollection
-
retainAll
Description copied from class:AbstractIntCollection- Specified by:
retainAllin interfaceCollection<Integer>- Specified by:
retainAllin interfaceSet<Integer>- Overrides:
retainAllin classAbstractIntCollection
-
removeIf
Deprecated.Description copied from interface:IntCollection- Specified by:
removeIfin interfaceCollection<Integer>- Specified by:
removeIfin interfaceIntCollection
-
forEach
Description copied from interface:IntIterablePerforms the given action for each element of this type-specificIterableuntil all elements have been processed or the action throws an exception.- Specified by:
forEachin interfaceIntIterable- Parameters:
action- the action to be performed for each element.- See Also:
-
addAll
Description copied from interface:IntCollectionAdds all elements of the given type-specific collection to this collection.- Specified by:
addAllin interfaceIntCollection- Overrides:
addAllin classAbstractIntCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
removeAll
Description copied from interface:IntCollectionRemove from this collection all elements in the given type-specific collection.- Specified by:
removeAllin interfaceIntCollection- Overrides:
removeAllin classAbstractIntCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
retainAll
Description copied from interface:IntCollectionRetains in this collection only elements from the given type-specific collection.- Specified by:
retainAllin interfaceIntCollection- Overrides:
retainAllin classAbstractIntCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
removeIf
Description copied from interface:IntCollectionRemove from this collection all elements which satisfy the given predicate.- Specified by:
removeIfin interfaceIntCollection- Parameters:
filter- a predicate which returnstruefor elements to be removed.- Returns:
trueif any elements were removed.- See Also:
-
toArray
Deprecated.- Specified by:
toArrayin interfaceCollection<Integer>- Specified by:
toArrayin interfaceSet<Integer>- Overrides:
toArrayin classAbstractCollection<Integer>
-
clone
-