it.unimi.dsi.fastutil.objects
Class ObjectCollections.SynchronizedCollection<K>

java.lang.Object
  extended by it.unimi.dsi.fastutil.objects.ObjectCollections.SynchronizedCollection<K>
All Implemented Interfaces:
ObjectCollection<K>, ObjectIterable<K>, java.io.Serializable, java.lang.Iterable<K>, java.util.Collection<K>
Direct Known Subclasses:
ObjectBigLists.SynchronizedBigList, ObjectLists.SynchronizedList, ObjectSets.SynchronizedSet
Enclosing class:
ObjectCollections

public static class ObjectCollections.SynchronizedCollection<K>
extends java.lang.Object
implements ObjectCollection<K>, java.io.Serializable

A synchronized 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 rem(java.lang.Object k)
           
 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>

toArray

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

toArray

public <T> T[] toArray(T[] a)
Description copied from interface: ObjectCollection
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 ObjectCollection<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[])

iterator

public ObjectIterator<K> iterator()
Description copied from interface: ObjectCollection
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 ObjectCollection<K>
Specified by:
iterator in interface ObjectIterable<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: ObjectCollection
Returns a type-specific iterator on this elements of this collection.

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

add

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

rem

public boolean rem(java.lang.Object 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