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:
- Serialized Form
-
Method Summary
Modifier and Type Method Description booleanaddAll(Collection<? extends K> c)Objectclone()booleancontains(Object k)ObjectListIterator<K>iterator()Returns a type-specific iterator on the elements of this collection.booleanremove(Object k)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()Methods inherited from class java.util.AbstractCollection
add, clear, containsAll, isEmpty, toArray, toArrayMethods inherited from interface java.util.Set
add, clear, containsAll, isEmpty, spliterator, toArray, 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:ReferenceCollectionReturns a type-specific iterator on the elements of this collection.Note that this specification strengthens the one given in
Iterable.iterator(), which was already strengthened in the corresponding type-specific class, but was weakened by the fact that this interface extendsCollection.- Specified by:
iteratorin interfaceCollection<K>- Specified by:
iteratorin interfaceIterable<K>- Specified by:
iteratorin interfaceObjectIterable<K>- Specified by:
iteratorin interfaceReferenceCollection<K>- Specified by:
iteratorin interfaceReferenceSet<K>- Specified by:
iteratorin interfaceSet<K>- Specified by:
iteratorin classAbstractReferenceSet<K>- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
size
public int size()- Specified by:
sizein interfaceCollection<K>- Specified by:
sizein interfaceSet<K>- Specified by:
sizein classAbstractCollection<K>
-
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>
-
clone
-