Package it.unimi.dsi.fastutil.objects
Class ReferenceCollections.UnmodifiableCollection<K>
- java.lang.Object
-
- it.unimi.dsi.fastutil.objects.ReferenceCollections.UnmodifiableCollection<K>
-
- All Implemented Interfaces:
ObjectIterable<K>
,ReferenceCollection<K>
,java.io.Serializable
,java.lang.Iterable<K>
,java.util.Collection<K>
- Direct Known Subclasses:
ReferenceBigLists.UnmodifiableBigList
,ReferenceLists.UnmodifiableList
,ReferenceSets.UnmodifiableSet
- Enclosing class:
- ReferenceCollections
public static class ReferenceCollections.UnmodifiableCollection<K> extends java.lang.Object implements ReferenceCollection<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 boolean
add(K k)
boolean
addAll(java.util.Collection<? extends K> c)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
equals(java.lang.Object o)
int
hashCode()
boolean
isEmpty()
ObjectIterator<K>
iterator()
Returns a type-specific iterator on the elements of this collection.boolean
remove(java.lang.Object k)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
java.lang.String
toString()
-
-
-
Method Detail
-
remove
public boolean remove(java.lang.Object k)
- Specified by:
remove
in interfacejava.util.Collection<K>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<K>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<K>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<K>
-
iterator
public ObjectIterator<K> iterator()
Description copied from interface:ReferenceCollection
Returns 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:
iterator
in interfacejava.util.Collection<K>
- Specified by:
iterator
in interfacejava.lang.Iterable<K>
- Specified by:
iterator
in interfaceObjectIterable<K>
- Specified by:
iterator
in interfaceReferenceCollection<K>
- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<K>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfacejava.util.Collection<K>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection<K>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAll
in interfacejava.util.Collection<K>
-
addAll
public boolean addAll(java.util.Collection<? extends K> c)
- Specified by:
addAll
in interfacejava.util.Collection<K>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<K>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interfacejava.util.Collection<K>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection<K>
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in interfacejava.util.Collection<K>
- Overrides:
equals
in classjava.lang.Object
-
-