pivot.collections
Interface Set<E>

All Superinterfaces:
Collection<E>, Group<E>, Iterable<E>
All Known Implementing Classes:
EnumSet, HashSet, ImmutableSet, SetAdapter, SynchronizedSet

public interface Set<E>
extends Group<E>, Collection<E>

Collection interface representing a group of unique elements.

Author:
gbrown

Nested Class Summary
static class Set.SetListenerList<E>
          Set listener list implementation.
 
Method Summary
 void add(E element)
          Adds an element to the group.
 void clear()
          Removes all elements from the collection.
 ListenerList<SetListener<E>> getSetListeners()
          Returns the set listener collection.
 void 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 interface pivot.collections.Group
contains, isEmpty
 
Methods inherited from interface pivot.collections.Collection
getComparator
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

add

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

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

remove

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

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

clear

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

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

setComparator

void setComparator(Comparator<E> comparator)
Description copied from interface: Collection
Sets the collection's sort order, re-ordering the collection's contents and ensuring that new entries preserve the sort order.

Specified by:
setComparator in interface Collection<E>
Parameters:
comparator - The comparator used to order elements in the collection, or null if the collection is unsorted.
See Also:
SetListener.setCleared(Set)

getSetListeners

ListenerList<SetListener<E>> getSetListeners()
Returns the set listener collection.