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:
ObjectCollection<K>,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:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAll(Collection<? extends K> c) clone()booleanvoiditerator()Returns a type-specific iterator on the elements of this collection.booleanbooleanremoveAll(Collection<?> c) booleanbooleanretainAll(Collection<?> c) intsize()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 interface java.util.Collection
parallelStream, stream, toArray
-
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:ObjectCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfaceCollection<K>- Specified by:
iteratorin interfaceIterable<K>- Specified by:
iteratorin interfaceObjectCollection<K>- Specified by:
iteratorin interfaceObjectIterable<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 collection.
- See Also:
-
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 interfaceObjectCollection<K>- Specified by:
spliteratorin interfaceObjectIterable<K>- Specified by:
spliteratorin interfaceObjectSet<K>- Specified by:
spliteratorin interfaceSet<K>- Returns:
- a type-specific spliterator on the elements of this collection.
-
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
-