Package it.unimi.dsi.fastutil.longs
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:
it.unimi.dsi.fastutil.longs.LongCollection,it.unimi.dsi.fastutil.longs.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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAll(it.unimi.dsi.fastutil.longs.LongCollection c) booleanaddAll(Collection<? extends Long> c) clone()booleancontains(long k) voidDeprecated.voidforEach(LongConsumer action) it.unimi.dsi.fastutil.longs.LongListIteratoriterator()Returns a type-specific iterator on the elements of this set.booleanremove(long k) Removes an element from this set.booleanremoveAll(it.unimi.dsi.fastutil.longs.LongCollection c) booleanremoveAll(Collection<?> c) booleanremoveIf(LongPredicate filter) booleanDeprecated.booleanretainAll(it.unimi.dsi.fastutil.longs.LongCollection c) booleanretainAll(Collection<?> c) intsize()it.unimi.dsi.fastutil.longs.LongSpliteratorReturns a type-specific spliterator on the elements of this set.Object[]toArray()Deprecated.long[]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 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.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
-
Field Details
-
element
protected final long element
-
-
Constructor Details
-
Singleton
protected Singleton(long element)
-
-
Method Details
-
contains
public boolean contains(long k) - Specified by:
containsin interfaceit.unimi.dsi.fastutil.longs.LongCollection- Overrides:
containsin classit.unimi.dsi.fastutil.longs.AbstractLongCollection
-
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
public it.unimi.dsi.fastutil.longs.LongListIterator iterator()Description copied from interface:LongSetReturns a type-specific iterator on the elements of this set.- Specified by:
iteratorin interfaceCollection<Long>- Specified by:
iteratorin interfaceIterable<Long>- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.longs.LongCollection- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.longs.LongIterable- Specified by:
iteratorin interfaceLongSet- Specified by:
iteratorin interfaceSet<Long>- Specified by:
iteratorin classAbstractLongSet- Returns:
- a type-specific iterator on the elements of this set.
-
spliterator
public it.unimi.dsi.fastutil.longs.LongSpliterator spliterator()Description copied from interface:LongSetReturns 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<Long>- Specified by:
spliteratorin interfaceIterable<Long>- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.longs.LongCollection- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.longs.LongIterable- Specified by:
spliteratorin interfaceLongSet- Specified by:
spliteratorin interfaceSet<Long>- Returns:
-
size
public int size()- Specified by:
sizein interfaceCollection<Long>- Specified by:
sizein interfaceSet<Long>- Specified by:
sizein classAbstractCollection<Long>
-
toLongArray
public long[] toLongArray()- Specified by:
toLongArrayin interfaceit.unimi.dsi.fastutil.longs.LongCollection- Overrides:
toLongArrayin classit.unimi.dsi.fastutil.longs.AbstractLongCollection
-
forEach
Deprecated. -
addAll
-
removeAll
-
retainAll
-
removeIf
Deprecated.- Specified by:
removeIfin interfaceCollection<Long>- Specified by:
removeIfin interfaceit.unimi.dsi.fastutil.longs.LongCollection
-
forEach
- Specified by:
forEachin interfaceit.unimi.dsi.fastutil.longs.LongIterable
-
addAll
public boolean addAll(it.unimi.dsi.fastutil.longs.LongCollection c) - Specified by:
addAllin interfaceit.unimi.dsi.fastutil.longs.LongCollection- Overrides:
addAllin classit.unimi.dsi.fastutil.longs.AbstractLongCollection
-
removeAll
public boolean removeAll(it.unimi.dsi.fastutil.longs.LongCollection c) - Specified by:
removeAllin interfaceit.unimi.dsi.fastutil.longs.LongCollection- Overrides:
removeAllin classit.unimi.dsi.fastutil.longs.AbstractLongCollection
-
retainAll
public boolean retainAll(it.unimi.dsi.fastutil.longs.LongCollection c) - Specified by:
retainAllin interfaceit.unimi.dsi.fastutil.longs.LongCollection- Overrides:
retainAllin classit.unimi.dsi.fastutil.longs.AbstractLongCollection
-
removeIf
- Specified by:
removeIfin interfaceit.unimi.dsi.fastutil.longs.LongCollection
-
toArray
Deprecated.- Specified by:
toArrayin interfaceCollection<Long>- Specified by:
toArrayin interfaceSet<Long>- Overrides:
toArrayin classAbstractCollection<Long>
-
clone
-