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>, Serializable, Iterable<K>, Collection<K>
Direct Known Subclasses:
ReferenceBigLists.UnmodifiableBigList, ReferenceLists.UnmodifiableList, ReferenceSets.UnmodifiableSet
Enclosing class:
ReferenceCollections

public static class ReferenceCollections.UnmodifiableCollection<K>
extends Object
implements ReferenceCollection<K>, Serializable

An unmodifiable wrapper class for collections.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Method Summary
 boolean add(K k)
           
 boolean addAll(Collection<? extends K> c)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 boolean isEmpty()
           
 ObjectIterator<K> iterator()
          Returns a type-specific iterator on the elements of this collection.
 ObjectIterator<K> objectIterator()
          Deprecated. 
 boolean remove(Object ok)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 int size()
           
 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.
 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
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Method Detail

size

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

isEmpty

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

contains

public boolean contains(Object o)
Specified by:
contains in interface 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 Iterable<K>
Specified by:
iterator in interface 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 Collection<K>

remove

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

addAll

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

containsAll

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

removeAll

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

retainAll

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

clear

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

toString

public String toString()
Overrides:
toString in class 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 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 Object[] toArray()
Specified by:
toArray in interface Collection<K>