public class SynchronizedCollection extends Object implements Collection, Serializable
Collection
.Constructor and Description |
---|
SynchronizedCollection(Collection delegate)
Creates a synchronized view of the specified
Collection . |
SynchronizedCollection(Collection delegate,
Object mutex)
Creates a synchronized view of the specified
Collection and synchronized upon the specified
object. |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Object object) |
boolean |
addAll(Collection collection) |
void |
clear() |
boolean |
contains(Object object) |
boolean |
containsAll(Collection collection) |
boolean |
isEmpty() |
Iterator |
iterator() |
boolean |
remove(Object object) |
boolean |
removeAll(Collection collection) |
boolean |
retainAll(Collection collection) |
int |
size() |
Object[] |
toArray() |
Object[] |
toArray(Object[] array) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode
public SynchronizedCollection(Collection delegate)
Collection
. It is the user's responsibility to
manually synchronize on the created Collection
when iterating over it. The created Collection
will be serializable if the specified delegate
is
serializable.delegate
- the Collection
for which a
synchronized view is to be created.public SynchronizedCollection(Collection delegate, Object mutex)
Collection
and synchronized upon the specified
object. It is the user's responsibility to manually
synchronize on the created Collection
when
iterating over it. The created Collection
will
be serializable if the specified delegate
is
serializable.delegate
- the Collection
for which a
synchronized view is to be created.public int size()
size
in interface Collection
public boolean isEmpty()
isEmpty
in interface Collection
public void clear()
clear
in interface Collection
public boolean add(Object object)
add
in interface Collection
public boolean remove(Object object)
remove
in interface Collection
public boolean contains(Object object)
contains
in interface Collection
public Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
public boolean addAll(Collection collection)
addAll
in interface Collection
public boolean containsAll(Collection collection)
containsAll
in interface Collection
public boolean removeAll(Collection collection)
removeAll
in interface Collection
public boolean retainAll(Collection collection)
retainAll
in interface Collection
public Object[] toArray()
toArray
in interface Collection
public Object[] toArray(Object[] array)
toArray
in interface Collection
See the Plexus project home, hosted by SourceForge.
Copyright ? 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.