pivot.collections.concurrent
Class SynchronizedSet<E>

java.lang.Object
  extended by pivot.collections.concurrent.SynchronizedCollection<E>
      extended by pivot.collections.concurrent.SynchronizedSet<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, Group<E>, Set<E>

public class SynchronizedSet<E>
extends SynchronizedCollection<E>
implements Set<E>

Synchronized implementation of the Set interface.

Author:
gbrown

Nested Class Summary
 
Nested classes/interfaces inherited from interface pivot.collections.Set
Set.SetListenerList<E>
 
Field Summary
 
Fields inherited from class pivot.collections.concurrent.SynchronizedCollection
collection
 
Constructor Summary
SynchronizedSet(Set<E> set)
           
 
Method Summary
 void 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.
 ListenerList<SetListener<E>> getSetListeners()
          Returns the set listener collection.
 boolean isEmpty()
          Tests the emptiness of the group.
 void remove(E element)
          Removes an element from the group.
 
Methods inherited from class pivot.collections.concurrent.SynchronizedCollection
getComparator, iterator, setComparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface pivot.collections.Set
setComparator
 
Methods inherited from interface pivot.collections.Collection
getComparator
 
Methods inherited from interface java.lang.Iterable
iterator
 

Constructor Detail

SynchronizedSet

public SynchronizedSet(Set<E> set)
Method Detail

add

public void add(E element)
Description copied from interface: Group
Adds an element to the group.

Specified by:
add in interface Group<E>
Specified by:
add in interface Set<E>
Parameters:
element - The element to add to the group.
See Also:
SetListener.elementAdded(Set, Object)

remove

public void remove(E element)
Description copied from interface: Group
Removes an element from the group.

Specified by:
remove in interface Group<E>
Specified by:
remove in interface Set<E>
Parameters:
element - The element to remove from the set.
See Also:
SetListener.elementRemoved(Set, Object)

clear

public void clear()
Description copied from interface: Collection
Removes all elements from the collection.

Specified by:
clear in interface Collection<E>
Specified by:
clear in interface Set<E>
See Also:
SetListener.setCleared(Set)

contains

public boolean contains(E element)
Description copied from interface: Group
Tests the existence of an element in the group.

Specified by:
contains in interface Group<E>
Parameters:
element - The element whose presence in the group is to be tested.
Returns:
true if the element exists in the group; false, otherwise.

isEmpty

public boolean isEmpty()
Description copied from interface: Group
Tests the emptiness of the group.

Specified by:
isEmpty in interface Group<E>
Returns:
true if the group contains no elements; false, otherwise.

getSetListeners

public ListenerList<SetListener<E>> getSetListeners()
Description copied from interface: Set
Returns the set listener collection.

Specified by:
getSetListeners in interface Set<E>