|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.TreeSet
nl.knowledgeplaza.util.collection.ObservableSortedSet
public class ObservableSortedSet
The ObservableSortedSet subclasses the TreeSet and overrides all the functions that change the internally stored collection. In the overridden function, it simply calls the super class's function and fires a CollectionEvent to let observers know the collection has changed.
| Field Summary | |
|---|---|
protected java.util.ArrayList |
listeners
the observers of this collection |
| Constructor Summary | |
|---|---|
ObservableSortedSet()
Constructs a new, empty set, sorted according to the elements' natural order. |
|
ObservableSortedSet(java.util.Collection c)
Constructs a new set containing the elements in the specified collection, sorted according to the elements' natural order. |
|
ObservableSortedSet(java.util.Comparator c)
Constructs a new, empty set, sorted according to the specified comparator. |
|
ObservableSortedSet(java.util.SortedSet s)
Constructs a new set containing the same elements as the specified sorted set, sorted according to the same ordering. |
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object o)
Calls the super class's corresponding method and fires a CollectionEvent. |
boolean |
addAll(java.util.Collection c)
Calls the super class's corresponding method and fires a CollectionEvent. |
void |
addCollectionListener(CollectionListener l)
Adds a listener to this collection. |
void |
clear()
Calls the super class's corresponding method and fires a CollectionEvent. |
protected void |
fireCollectionEvent(CollectionEvent e)
Fires a CollectionEvent to all listeners. |
java.lang.Object |
getObservedCollection()
To access the collection that is being observed. |
boolean |
remove(java.lang.Object o)
Calls the super class's corresponding method and fires a CollectionEvent. |
boolean |
removeAll(java.util.Collection c)
Calls the super class's corresponding method and fires a CollectionEvent. |
void |
removeCollectionListener(CollectionListener l)
Removes the listener from this collection. |
boolean |
retainAll(java.util.Collection c)
Calls the super class's corresponding method and fires a CollectionEvent. |
| Methods inherited from class java.util.TreeSet |
|---|
clone, comparator, contains, first, headSet, isEmpty, iterator, last, size, subSet, tailSet |
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
containsAll, equals, hashCode, toArray, toArray |
| Field Detail |
|---|
protected java.util.ArrayList listeners
| Constructor Detail |
|---|
public ObservableSortedSet()
public ObservableSortedSet(java.util.Comparator c)
c - the comparator that will be used to sort this set. A null value indicates that the elements' natural ordering should be used.public ObservableSortedSet(java.util.Collection c)
c - The elements that will comprise the new set.public ObservableSortedSet(java.util.SortedSet s)
s - sorted set whose elements will comprise the new set.| Method Detail |
|---|
public boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Setadd in class java.util.TreeSetpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Setremove in class java.util.TreeSetpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.SetaddAll in class java.util.TreeSetpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.SetremoveAll in class java.util.AbstractSetpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Setclear in class java.util.TreeSetpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionretainAll in interface java.util.SetretainAll in class java.util.AbstractCollectionpublic void addCollectionListener(CollectionListener l)
addCollectionListener in interface ObservableCollectionl - the CollectionListenerpublic void removeCollectionListener(CollectionListener l)
removeCollectionListener in interface ObservableCollectionl - the CollectionListenerprotected void fireCollectionEvent(CollectionEvent e)
e - the CollectionEventpublic java.lang.Object getObservedCollection()
getObservedCollection in interface ObservableCollection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||