Class LongSets.Singleton
java.lang.Object
java.util.AbstractCollection<Long>
it.unimi.dsi.fastutil.longs.AbstractLongCollection
it.unimi.dsi.fastutil.longs.AbstractLongSet
it.unimi.dsi.fastutil.longs.LongSets.Singleton
- All Implemented Interfaces:
LongCollection,LongIterable,LongSet,Serializable,Cloneable,Iterable<Long>,Collection<Long>,Set<Long>
- Direct Known Subclasses:
LongSortedSets.Singleton
- Enclosing class:
LongSets
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 Long> c) clone()booleancontains(long k) Returnstrueif this collection contains the specified element.voidDeprecated.voidforEach(LongConsumer 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(long k) Removes an element from this set.booleanRemove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c) booleanremoveIf(LongPredicate 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.long[]Returns a primitive type array containing the items of this collection.Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongSet
equals, hashCode, remMethods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongCollection
add, add, contains, containsAll, containsAll, forEach, remove, removeIf, toArray, toLongArray, toStringMethods inherited from class java.util.AbstractCollection
clear, isEmpty, toArrayMethods inherited from interface java.util.Collection
toArrayMethods inherited from interface it.unimi.dsi.fastutil.longs.LongCollection
add, containsAll, longIterator, longParallelStream, longSpliterator, longStream, parallelStream, removeIf, stream, toArray, toLongArrayMethods inherited from interface it.unimi.dsi.fastutil.longs.LongIterable
forEachMethods inherited from interface java.util.Set
clear, containsAll, isEmpty, toArray
-
Method Details
-
contains
public boolean contains(long k) Description copied from class:AbstractLongCollectionReturnstrueif this collection contains the specified element.- Specified by:
containsin interfaceLongCollection- Overrides:
containsin classAbstractLongCollection- See Also:
-
remove
public boolean remove(long k) Description copied from class:AbstractLongSetRemoves an element from this set. Delegates to the type-specificrem()method implemented by type-specific abstractCollectionsuperclass.- Specified by:
removein interfaceLongSet- Overrides:
removein classAbstractLongSet- See Also:
-
iterator
Description copied from interface:LongCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfaceCollection<Long>- Specified by:
iteratorin interfaceIterable<Long>- Specified by:
iteratorin interfaceLongCollection- Specified by:
iteratorin interfaceLongIterable- Specified by:
iteratorin interfaceLongSet- Specified by:
iteratorin interfaceSet<Long>- Specified by:
iteratorin classAbstractLongSet- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
spliterator
Description copied from interface:LongCollectionReturns 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<Long>- Specified by:
spliteratorin interfaceIterable<Long>- Specified by:
spliteratorin interfaceLongCollection- Specified by:
spliteratorin interfaceLongIterable- Specified by:
spliteratorin interfaceLongSet- Specified by:
spliteratorin interfaceSet<Long>- Returns:
- a type-specific spliterator on the elements of this collection.
-
size
public int size()- Specified by:
sizein interfaceCollection<Long>- Specified by:
sizein interfaceSet<Long>- Specified by:
sizein classAbstractCollection<Long>
-
toLongArray
public long[] toLongArray()Description copied from interface:LongCollectionReturns a primitive type array containing the items of this collection.- Specified by:
toLongArrayin interfaceLongCollection- Overrides:
toLongArrayin classAbstractLongCollection- Returns:
- a primitive type array containing the items of this collection.
- See Also:
-
forEach
Deprecated.Description copied from interface:LongIterable- Specified by:
forEachin interfaceIterable<Long>- Specified by:
forEachin interfaceLongIterable
-
addAll
Description copied from class:AbstractLongCollection- Specified by:
addAllin interfaceCollection<Long>- Specified by:
addAllin interfaceSet<Long>- Overrides:
addAllin classAbstractLongCollection
-
removeAll
Description copied from class:AbstractLongCollection- Specified by:
removeAllin interfaceCollection<Long>- Specified by:
removeAllin interfaceSet<Long>- Overrides:
removeAllin classAbstractLongCollection
-
retainAll
Description copied from class:AbstractLongCollection- Specified by:
retainAllin interfaceCollection<Long>- Specified by:
retainAllin interfaceSet<Long>- Overrides:
retainAllin classAbstractLongCollection
-
removeIf
Deprecated.Description copied from interface:LongCollection- Specified by:
removeIfin interfaceCollection<Long>- Specified by:
removeIfin interfaceLongCollection
-
forEach
Description copied from interface:LongIterablePerforms the given action for each element of this type-specificIterableuntil all elements have been processed or the action throws an exception.- Specified by:
forEachin interfaceLongIterable- Parameters:
action- the action to be performed for each element.- See Also:
-
addAll
Description copied from interface:LongCollectionAdds all elements of the given type-specific collection to this collection.- Specified by:
addAllin interfaceLongCollection- Overrides:
addAllin classAbstractLongCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
removeAll
Description copied from interface:LongCollectionRemove from this collection all elements in the given type-specific collection.- Specified by:
removeAllin interfaceLongCollection- Overrides:
removeAllin classAbstractLongCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
retainAll
Description copied from interface:LongCollectionRetains in this collection only elements from the given type-specific collection.- Specified by:
retainAllin interfaceLongCollection- Overrides:
retainAllin classAbstractLongCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
removeIf
Description copied from interface:LongCollectionRemove from this collection all elements which satisfy the given predicate.- Specified by:
removeIfin interfaceLongCollection- Parameters:
filter- a predicate which returnstruefor elements to be removed.- Returns:
trueif any elements were removed.- See Also:
-
toArray
Deprecated.- Specified by:
toArrayin interfaceCollection<Long>- Specified by:
toArrayin interfaceSet<Long>- Overrides:
toArrayin classAbstractCollection<Long>
-
clone
-