Package it.unimi.dsi.fastutil.objects
Class ObjectSets.Singleton<K>
java.lang.Object
java.util.AbstractCollection<K>
it.unimi.dsi.fastutil.objects.AbstractObjectCollection<K>
it.unimi.dsi.fastutil.objects.AbstractObjectSet<K>
it.unimi.dsi.fastutil.objects.ObjectSets.Singleton<K>
- All Implemented Interfaces:
it.unimi.dsi.fastutil.objects.ObjectCollection<K>,it.unimi.dsi.fastutil.objects.ObjectIterable<K>,ObjectSet<K>,Serializable,Cloneable,Iterable<K>,Collection<K>,Set<K>
- Direct Known Subclasses:
ObjectSortedSets.Singleton
- Enclosing class:
ObjectSets
public static class ObjectSets.Singleton<K>
extends AbstractObjectSet<K>
implements Serializable, Cloneable
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(Collection<? extends K> c) clone()booleanvoidit.unimi.dsi.fastutil.objects.ObjectListIterator<K> iterator()Returns a type-specific iterator on the elements of this set.booleanbooleanremoveAll(Collection<?> c) booleanbooleanretainAll(Collection<?> c) intsize()it.unimi.dsi.fastutil.objects.ObjectSpliterator<K> Returns a type-specific spliterator on the elements of this set.Object[]toArray()Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectSet
equals, hashCodeMethods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectCollection
toStringMethods inherited from class java.util.AbstractCollection
add, clear, containsAll, isEmpty, toArrayMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Field Details
-
element
-
-
Constructor Details
-
Singleton
-
-
Method Details
-
contains
- Specified by:
containsin interfaceCollection<K>- Specified by:
containsin interfaceSet<K>- Overrides:
containsin classAbstractCollection<K>
-
remove
- Specified by:
removein interfaceCollection<K>- Specified by:
removein interfaceSet<K>- Overrides:
removein classAbstractCollection<K>
-
iterator
Description copied from interface:ObjectSetReturns a type-specific iterator on the elements of this set.- Specified by:
iteratorin interfaceCollection<K>- Specified by:
iteratorin interfaceIterable<K>- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectCollection<K>- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectIterable<K>- Specified by:
iteratorin interfaceObjectSet<K>- Specified by:
iteratorin interfaceSet<K>- Specified by:
iteratorin classAbstractObjectSet<K>- Returns:
- a type-specific iterator on the elements of this set.
-
spliterator
Description copied from interface:ObjectSetReturns 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<K>- Specified by:
spliteratorin interfaceIterable<K>- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectCollection<K>- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectIterable<K>- Specified by:
spliteratorin interfaceObjectSet<K>- Specified by:
spliteratorin interfaceSet<K>- Returns:
-
size
public int size()- Specified by:
sizein interfaceCollection<K>- Specified by:
sizein interfaceSet<K>- Specified by:
sizein classAbstractCollection<K>
-
toArray
- Specified by:
toArrayin interfaceCollection<K>- Specified by:
toArrayin interfaceSet<K>- Overrides:
toArrayin classAbstractCollection<K>
-
forEach
-
addAll
- Specified by:
addAllin interfaceCollection<K>- Specified by:
addAllin interfaceSet<K>- Overrides:
addAllin classAbstractCollection<K>
-
removeAll
- Specified by:
removeAllin interfaceCollection<K>- Specified by:
removeAllin interfaceSet<K>- Overrides:
removeAllin classAbstractCollection<K>
-
retainAll
- Specified by:
retainAllin interfaceCollection<K>- Specified by:
retainAllin interfaceSet<K>- Overrides:
retainAllin classAbstractCollection<K>
-
removeIf
- Specified by:
removeIfin interfaceCollection<K>
-
clone
-