Package it.unimi.dsi.fastutil.objects
Class ObjectCollections.UnmodifiableCollection<K>
- java.lang.Object
-
- it.unimi.dsi.fastutil.objects.ObjectCollections.UnmodifiableCollection<K>
-
- All Implemented Interfaces:
ObjectCollection<K>,ObjectIterable<K>,java.io.Serializable,java.lang.Iterable<K>,java.util.Collection<K>
- Direct Known Subclasses:
ObjectBigLists.UnmodifiableBigList,ObjectLists.UnmodifiableList,ObjectSets.UnmodifiableSet
- Enclosing class:
- ObjectCollections
public static class ObjectCollections.UnmodifiableCollection<K> extends java.lang.Object implements ObjectCollection<K>, java.io.Serializable
An unmodifiable wrapper class for collections.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(K k)booleanaddAll(java.util.Collection<? extends K> c)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)booleanequals(java.lang.Object o)inthashCode()booleanisEmpty()ObjectIterator<K>iterator()Returns a type-specific iterator on the elements of this collection.booleanremove(java.lang.Object k)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)intsize()java.lang.Object[]toArray()<T> T[]toArray(T[] a)java.lang.StringtoString()
-
-
-
Method Detail
-
remove
public boolean remove(java.lang.Object k)
- Specified by:
removein interfacejava.util.Collection<K>
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection<K>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection<K>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
containsin interfacejava.util.Collection<K>
-
iterator
public ObjectIterator<K> iterator()
Description copied from interface:ObjectCollectionReturns 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 interfacejava.util.Collection<K>- Specified by:
iteratorin interfacejava.lang.Iterable<K>- Specified by:
iteratorin interfaceObjectCollection<K>- Specified by:
iteratorin interfaceObjectIterable<K>- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<K>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfacejava.util.Collection<K>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection<K>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAllin interfacejava.util.Collection<K>
-
addAll
public boolean addAll(java.util.Collection<? extends K> c)
- Specified by:
addAllin interfacejava.util.Collection<K>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAllin interfacejava.util.Collection<K>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAllin interfacejava.util.Collection<K>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.util.Collection<K>- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin interfacejava.util.Collection<K>- Overrides:
equalsin classjava.lang.Object
-
-