|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.collections.adapter.SetAdapter<E>
public class SetAdapter<E>
Implementation of the Set
interface that is backed by an instance of
Set
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Set |
---|
Set.SetListenerList<E> |
Constructor Summary | |
---|---|
SetAdapter(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. |
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SetAdapter(Set<E> set)
Method Detail |
---|
public Set<E> getSet()
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 void clear()
Collection
clear
in interface Collection<E>
clear
in interface Set<E>
SetListener.setCleared(Set)
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 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)
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 Iterator<E> iterator()
iterator
in interface Iterable<E>
public ListenerList<SetListener<E>> getSetListeners()
Set
getSetListeners
in interface Set<E>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |