com.phoenixst.collections
Class SynchronizedCollection
java.lang.Object
com.phoenixst.collections.SynchronizedCollection
- All Implemented Interfaces:
- Serializable, Iterable, Collection
public class SynchronizedCollection
- extends Object
- implements Collection, Serializable
A synchronized view of another Collection
.
- Since:
- 1.0
- Version:
- $Revision: 1.5 $
- Author:
- Ray A. Conner
- See Also:
- Serialized Form
SynchronizedCollection
public SynchronizedCollection(Collection delegate)
- Creates a synchronized view of the specified
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.
- Parameters:
delegate
- the Collection
for which a
synchronized view is to be created.
SynchronizedCollection
public SynchronizedCollection(Collection delegate,
Object mutex)
- Creates a synchronized view of the specified
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.
- Parameters:
delegate
- the Collection
for which a
synchronized view is to be created.
size
public int size()
- Specified by:
size
in interface Collection
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface Collection
clear
public void clear()
- Specified by:
clear
in interface Collection
add
public boolean add(Object object)
- Specified by:
add
in interface Collection
remove
public boolean remove(Object object)
- Specified by:
remove
in interface Collection
contains
public boolean contains(Object object)
- Specified by:
contains
in interface Collection
iterator
public Iterator iterator()
- Specified by:
iterator
in interface Iterable
- Specified by:
iterator
in interface Collection
addAll
public boolean addAll(Collection collection)
- Specified by:
addAll
in interface Collection
containsAll
public boolean containsAll(Collection collection)
- Specified by:
containsAll
in interface Collection
removeAll
public boolean removeAll(Collection collection)
- Specified by:
removeAll
in interface Collection
retainAll
public boolean retainAll(Collection collection)
- Specified by:
retainAll
in interface Collection
toArray
public Object[] toArray()
- Specified by:
toArray
in interface Collection
toArray
public Object[] toArray(Object[] array)
- Specified by:
toArray
in interface Collection
toString
public String toString()
- Overrides:
toString
in class Object
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.