|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.springsource.util.common.SynchronizedObject
com.springsource.util.common.SynchronizedCollection<T>
T - type of element in collectionpublic class SynchronizedCollection<T>
SynchronizedCollection wraps a given Collection and protects access to the collection and any
iterators created from the collection by synchronizing on a given monitor.
| Field Summary | |
|---|---|
private java.util.Collection<T> |
collection
|
private java.lang.Object |
monitor
|
private static java.lang.Object |
tieMonitor
|
| Constructor Summary | |
|---|---|
SynchronizedCollection(java.util.Collection<? extends T> collection,
java.lang.Object monitor)
Creates a SynchronizedCollection wrapping the given collection and synchronizing on the given monitor,
neither of which may be null. |
|
| Method Summary | ||
|---|---|---|
boolean |
add(T e)
|
|
boolean |
addAll(java.util.Collection<? extends T> c)
|
|
void |
clear()
|
|
boolean |
contains(java.lang.Object o)
|
|
boolean |
containsAll(java.util.Collection<?> c)
|
|
boolean |
equals(java.lang.Object obj)
|
|
int |
hashCode()
|
|
boolean |
isEmpty()
|
|
java.util.Iterator<T> |
iterator()
|
|
boolean |
remove(java.lang.Object o)
|
|
boolean |
removeAll(java.util.Collection<?> c)
|
|
boolean |
retainAll(java.util.Collection<?> c)
|
|
int |
size()
|
|
java.lang.Object[] |
toArray()
|
|
|
toArray(U[] a)
|
|
| Methods inherited from class com.springsource.util.common.SynchronizedObject |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final java.util.Collection<T> collection
private final java.lang.Object monitor
private static final java.lang.Object tieMonitor
| Constructor Detail |
|---|
public SynchronizedCollection(java.util.Collection<? extends T> collection,
java.lang.Object monitor)
SynchronizedCollection wrapping the given collection and synchronizing on the given monitor,
neither of which may be null.
collection - the collection to be wrapped, which must not be nullmonitor - the monitor which will be used to synchronize access to the collection| Method Detail |
|---|
public int hashCode()
hashCode in interface java.util.Collection<T>hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in interface java.util.Collection<T>equals in class java.lang.Objectpublic boolean add(T e)
add in interface java.util.Collection<T>public boolean addAll(java.util.Collection<? extends T> c)
addAll in interface java.util.Collection<T>public void clear()
clear in interface java.util.Collection<T>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<T>public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<T>public boolean isEmpty()
isEmpty in interface java.util.Collection<T>public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>iterator in interface java.util.Collection<T>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<T>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<T>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<T>public int size()
size in interface java.util.Collection<T>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<T>public <U> U[] toArray(U[] a)
toArray in interface java.util.Collection<T>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||