|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.collections.concurrent.SynchronizedCollection<T>
public abstract class SynchronizedCollection<T>
Abstract base class for synchronized collection wrappers.
NOTE In order to guarantee thread-safe access, all access to the backing collection must be via the synchronized wrapper.
Field Summary | |
---|---|
protected Collection<T> |
collection
|
Constructor Summary | |
---|---|
SynchronizedCollection(Collection<T> collection)
|
Method Summary | |
---|---|
void |
clear()
Removes all elements from the collection. |
Comparator<T> |
getComparator()
Returns the collection's sort order. |
Iterator<T> |
iterator()
NOTE Callers must manually synchronize on the SynchronizedCollection instance to ensure thread safety during iteration. |
void |
setComparator(Comparator<T> comparator)
Sets the collection's sort order, re-ordering the collection's contents and ensuring that new entries preserve the sort order. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Collection<T> collection
Constructor Detail |
---|
public SynchronizedCollection(Collection<T> collection)
Method Detail |
---|
public void clear()
Collection
clear
in interface Collection<T>
public Comparator<T> getComparator()
Collection
getComparator
in interface Collection<T>
Collection.setComparator(Comparator)
public void setComparator(Comparator<T> comparator)
Collection
setComparator
in interface Collection<T>
comparator
- The comparator used to order elements in the collection, or null if the
collection is unsorted.public Iterator<T> iterator()
iterator
in interface Iterable<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |