|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.TreeMap
nl.knowledgeplaza.util.collection.ObservableSortedMap
public class ObservableSortedMap
The ObservableSortedMap subclasses the TreeMap 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 ArrayList |
listeners
the observers of this collection |
| Constructor Summary | |
|---|---|
ObservableSortedMap()
Constructs a new, empty map, sorted according to the keys' natural order. |
|
ObservableSortedMap(Comparator c)
Constructs a new, empty map, sorted according to the given comparator. |
|
ObservableSortedMap(Map m)
Constructs a new map containing the same mappings as the given map, sorted according to the keys' natural order. |
|
ObservableSortedMap(SortedMap m)
Constructs a new map containing the same mappings as the given SortedMap, sorted according to the same ordering. |
|
| Method Summary | |
|---|---|
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. |
Object |
getObservedCollection()
To access the collection that is being observed. |
Object |
put(Object key,
Object value)
Calls the super class's corresponding method and fires a CollectionEvent. |
void |
putAll(Map t)
Calls the super class's corresponding method and fires a CollectionEvent. |
Object |
remove(Object key)
Calls the super class's corresponding method and fires a CollectionEvent. |
void |
removeCollectionListener(CollectionListener l)
Removes the listener from this collection. |
| Methods inherited from class java.util.TreeMap |
|---|
clone, comparator, containsKey, containsValue, entrySet, firstKey, get, headMap, keySet, lastKey, size, subMap, tailMap, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, isEmpty, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode, isEmpty |
| Field Detail |
|---|
protected ArrayList listeners
| Constructor Detail |
|---|
public ObservableSortedMap()
public ObservableSortedMap(Comparator c)
c - the comparator that will be used to sort this map. A null value indicates that the keys' natural ordering should be used.public ObservableSortedMap(Map m)
m - the map whose mappings are to be placed in this map.public ObservableSortedMap(SortedMap m)
m - the sorted map whose mappings are to be placed in this map, and whose comparator is to be used to sort this map.| Method Detail |
|---|
public Object put(Object key,
Object value)
put in interface Mapput in class TreeMappublic Object remove(Object key)
remove in interface Mapremove in class TreeMappublic void putAll(Map t)
putAll in interface MapputAll in class TreeMappublic void clear()
clear in interface Mapclear in class TreeMappublic 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 Object getObservedCollection()
getObservedCollection in interface ObservableCollection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||