|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pivot.collections.concurrent.SynchronizedSet<E>
public class SynchronizedSet<E>
Synchronized implementation of the Set interface.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.pivot.collections.Set |
|---|
Set.SetListenerList<E> |
| Constructor Summary | |
|---|---|
SynchronizedSet(Set<E> set)
|
|
| Method Summary | |
|---|---|
boolean |
add(E element)
Adds an element to the group. |
void |
clear()
Removes all elements from the collection. |
boolean |
contains(E element)
Tests the existence of an element in the group. |
Comparator<E> |
getComparator()
Returns the collection's sort order. |
int |
getCount()
Returns the number of elements in the set. |
ListenerList<SetListener<E>> |
getSetListeners()
Returns the set listener collection. |
boolean |
isEmpty()
Tests the emptiness of the collection. |
Iterator<E> |
iterator()
NOTE Callers must manually synchronize on the SynchronizedSet instance to ensure thread safety during iteration. |
boolean |
remove(E element)
Removes an element from the group. |
void |
setComparator(Comparator<E> 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 |
| Constructor Detail |
|---|
public SynchronizedSet(Set<E> set)
| Method Detail |
|---|
public boolean add(E element)
Group
add in interface Group<E>add in interface Set<E>element - The element to add to the group.
SetListener.elementAdded(Set, Object)public boolean remove(E element)
Group
remove in interface Group<E>remove in interface Set<E>element - The element to remove from the set.
SetListener.elementRemoved(Set, Object)public boolean contains(E element)
Group
contains in interface Group<E>element - The element whose presence in the group is to be tested.
public boolean isEmpty()
Collection
isEmpty in interface Collection<E>public void clear()
Collection
clear in interface Collection<E>clear in interface Set<E>SetListener.setCleared(Set)public int getCount()
Set
getCount in interface Set<E>public Comparator<E> getComparator()
Collection
getComparator in interface Collection<E>Collection.setComparator(Comparator)public void setComparator(Comparator<E> comparator)
CollectionCalling this method more than once with the same comparator will re-sort the collection.
setComparator in interface Collection<E>setComparator in interface Set<E>comparator - The comparator used to order elements in the collection, or null if the
collection is unsorted.SetListener.setCleared(Set)public Iterator<E> iterator()
iterator in interface Iterable<E>public ListenerList<SetListener<E>> getSetListeners()
Set
getSetListeners in interface Set<E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||