Package it.unimi.dsi.fastutil.objects
Class ReferenceSets.Singleton<K>
java.lang.Object
java.util.AbstractCollection<K>
it.unimi.dsi.fastutil.objects.AbstractReferenceCollection<K>
it.unimi.dsi.fastutil.objects.AbstractReferenceSet<K>
it.unimi.dsi.fastutil.objects.ReferenceSets.Singleton<K>
- All Implemented Interfaces:
ObjectIterable<K>
,ReferenceCollection<K>
,ReferenceSet<K>
,Serializable
,Cloneable
,Iterable<K>
,Collection<K>
,Set<K>
- Direct Known Subclasses:
ReferenceSortedSets.Singleton
- Enclosing class:
ReferenceSets
public static class ReferenceSets.Singleton<K>
extends AbstractReferenceSet<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 TypeMethodDescriptionboolean
addAll
(Collection<? extends K> c) clone()
boolean
void
iterator()
Returns a type-specific iterator on the elements of this collection.boolean
boolean
removeAll
(Collection<?> c) boolean
boolean
retainAll
(Collection<?> c) int
size()
Returns a type-specific spliterator on the elements of this set.Object[]
toArray()
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractReferenceSet
equals, hashCode
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractReferenceCollection
toString
Methods inherited from class java.util.AbstractCollection
add, clear, containsAll, isEmpty, toArray
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Method Details
-
contains
- Specified by:
contains
in interfaceCollection<K>
- Specified by:
contains
in interfaceSet<K>
- Overrides:
contains
in classAbstractCollection<K>
-
remove
- Specified by:
remove
in interfaceCollection<K>
- Specified by:
remove
in interfaceSet<K>
- Overrides:
remove
in classAbstractCollection<K>
-
iterator
Description copied from interface:ReferenceCollection
Returns a type-specific iterator on the elements of this collection.- Specified by:
iterator
in interfaceCollection<K>
- Specified by:
iterator
in interfaceIterable<K>
- Specified by:
iterator
in interfaceObjectIterable<K>
- Specified by:
iterator
in interfaceReferenceCollection<K>
- Specified by:
iterator
in interfaceReferenceSet<K>
- Specified by:
iterator
in interfaceSet<K>
- Specified by:
iterator
in classAbstractReferenceSet<K>
- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
spliterator
Description copied from interface:ReferenceSet
Returns 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:
spliterator
in interfaceCollection<K>
- Specified by:
spliterator
in interfaceIterable<K>
- Specified by:
spliterator
in interfaceObjectIterable<K>
- Specified by:
spliterator
in interfaceReferenceCollection<K>
- Specified by:
spliterator
in interfaceReferenceSet<K>
- Specified by:
spliterator
in interfaceSet<K>
- Returns:
- a type-specific spliterator on the elements of this collection.
-
size
public int size()- Specified by:
size
in interfaceCollection<K>
- Specified by:
size
in interfaceSet<K>
- Specified by:
size
in classAbstractCollection<K>
-
toArray
- Specified by:
toArray
in interfaceCollection<K>
- Specified by:
toArray
in interfaceSet<K>
- Overrides:
toArray
in classAbstractCollection<K>
-
forEach
-
addAll
- Specified by:
addAll
in interfaceCollection<K>
- Specified by:
addAll
in interfaceSet<K>
- Overrides:
addAll
in classAbstractCollection<K>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<K>
- Specified by:
removeAll
in interfaceSet<K>
- Overrides:
removeAll
in classAbstractCollection<K>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<K>
- Specified by:
retainAll
in interfaceSet<K>
- Overrides:
retainAll
in classAbstractCollection<K>
-
removeIf
- Specified by:
removeIf
in interfaceCollection<K>
-
clone
-