it.unimi.dsi.fastutil.objects
Class ReferenceCollections.UnmodifiableCollection<K>

java.lang.Object
  extended by 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
 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 isEmpty()
           
 ObjectIterator<K> iterator()
          Returns a type-specific iterator on the elements of this collection.
 ObjectIterator<K> objectIterator()
          Deprecated. 
 boolean remove(java.lang.Object ok)
           
 boolean removeAll(java.util.Collection<?> c)
           
 boolean retainAll(java.util.Collection<?> c)
           
 int size()
           
 java.lang.Object[] toArray()
           
<T> T[]
toArray(T[] a)
          Returns an containing the items of this collection; the runtime type of the returned array is that of the specified array.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Method Detail

size

public int size()
Specified by:
size in interface java.util.Collection<K>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<K>

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.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 extends Collection.

Specified by:
iterator in interface ObjectIterable<K>
Specified by:
iterator in interface ReferenceCollection<K>
Specified by:
iterator in interface java.lang.Iterable<K>
Specified by:
iterator in interface java.util.Collection<K>
Returns:
a type-specific iterator on the elements of this collection.

objectIterator

@Deprecated
public ObjectIterator<K> objectIterator()
Deprecated. 

Description copied from interface: ReferenceCollection
Returns a type-specific iterator on this elements of this collection.

Specified by:
objectIterator in interface ReferenceCollection<K>
See Also:
ReferenceCollection.iterator()

add

public boolean add(K k)
Specified by:
add in interface java.util.Collection<K>

remove

public boolean remove(java.lang.Object ok)
Specified by:
remove in interface java.util.Collection<K>

addAll

public boolean addAll(java.util.Collection<? extends K> c)
Specified by:
addAll in interface java.util.Collection<K>

containsAll

public boolean containsAll(java.util.Collection<?> c)
Specified by:
containsAll in interface java.util.Collection<K>

removeAll

public boolean removeAll(java.util.Collection<?> c)
Specified by:
removeAll in interface java.util.Collection<K>

retainAll

public boolean retainAll(java.util.Collection<?> c)
Specified by:
retainAll in interface java.util.Collection<K>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<K>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toArray

public <T> T[] toArray(T[] a)
Description copied from interface: ReferenceCollection
Returns an containing the items of this collection; the runtime type of the returned array is that of the specified array.

Warning: Note that, contrarily to Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.

Specified by:
toArray in interface ReferenceCollection<K>
Specified by:
toArray in interface java.util.Collection<K>
Parameters:
a - if this array is big enough, it will be used to store this collection.
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray(Object[])

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<K>