public class SetAdapter<E> extends Object implements Set<E>, Serializable
Set.SetListenerList<E>
Constructor and Description |
---|
SetAdapter(Set<E> set) |
Modifier and Type | Method and Description |
---|---|
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.
|
Set<E> |
getSet() |
ListenerList<SetListener<E>> |
getSetListeners()
Returns the set listener collection.
|
boolean |
isEmpty()
Tests the emptiness of the collection.
|
Iterator<E> |
iterator() |
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.
|
String |
toString() |
public boolean add(E element)
Group
public boolean remove(E element)
Group
public void clear()
Collection
clear
in interface Collection<E>
clear
in interface Set<E>
SetListener.setCleared(Set)
public boolean contains(E element)
Group
public boolean isEmpty()
Collection
isEmpty
in interface Collection<E>
public int getCount()
Set
public Comparator<E> getComparator()
Collection
getComparator
in interface Collection<E>
Collection.setComparator(Comparator)
public void setComparator(Comparator<E> comparator)
Collection
Calling 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 ListenerList<SetListener<E>> getSetListeners()
Set
getSetListeners
in interface Set<E>