|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
displayablecollections.DisplayableTreeMap<K,V>
public class DisplayableTreeMap<K,V>
A DisplayableTreeMap encapsulates a TreeMap and allows it to be displayed by a JList
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface displayablecollections.DisplayableMap |
---|
DisplayableMap.MapChangedNotification<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Constructor Summary | |
---|---|
DisplayableTreeMap()
Constructs a new empty Map |
|
DisplayableTreeMap(java.util.Comparator<? super K> c)
Constructs a new empty Map according to the specified comparator |
|
DisplayableTreeMap(java.util.Map<? extends K,? extends V> m)
Constructs a new Map containing the same mappings as the given map, sorted according to the key's natural order |
|
DisplayableTreeMap(java.util.SortedMap<? extends K,? extends V> s)
Constructs a new Map containing the same elements as the specified Map, sorted according to the same ordering |
Method Summary | |
---|---|
void |
clear()
|
java.util.Comparator<? super K> |
comparator()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
Returns a set view of the mappings contained in this map. |
boolean |
equals(java.lang.Object o)
|
K |
firstKey()
|
V |
get(java.lang.Object key)
|
int |
hashCode()
|
java.util.SortedMap<K,V> |
headMap(K toKey)
Returns a view of the portion of this sorted map whose keys are strictly less than toKey. |
boolean |
isEmpty()
|
javax.swing.ListModel |
keyOrderedListModel()
Create a list model for displaying the values in this map in a JList. |
java.util.Set<K> |
keySet()
Returns a set view of the keys contained in this map. |
K |
lastKey()
|
javax.swing.ListModel |
listModel()
Create a list model for displaying this map's values in a JList. |
V |
put(K key,
V value)
|
void |
putAll(java.util.Map<? extends K,? extends V> t)
|
V |
remove(java.lang.Object key)
|
int |
size()
|
java.util.SortedMap<K,V> |
subMap(K fromKey,
K toKey)
Returns a view of the portion of this sorted map whose keys range from fromKey, inclusive, to toKey, exclusive. |
java.util.SortedMap<K,V> |
tailMap(K fromKey)
Returns a view of the portion of this sorted map whose keys are greater than or equal to fromKey. |
javax.swing.ListModel |
valueOrderedListModel()
Create a list model for displaying the values in this map in a JList. |
javax.swing.ListModel |
valueOrderedListModel(java.util.Comparator<V> comparator)
Create a list model for displaying the values in this map in a JList. |
java.util.Collection<V> |
values()
Returns a collection view of the values contained in this map. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface displayablecollections.DisplayableMap |
---|
addObserver, deleteObservers, entrySet, keySet, listModel, valueOrderedListModel, valueOrderedListModel, values |
Methods inherited from interface java.util.SortedMap |
---|
entrySet, keySet, values |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, put, putAll, remove, size |
Constructor Detail |
---|
public DisplayableTreeMap()
public DisplayableTreeMap(java.util.Comparator<? super K> c)
c
- the comparatorpublic DisplayableTreeMap(java.util.Map<? extends K,? extends V> m)
m
- the map whose mappings are to be placed in the Mappublic DisplayableTreeMap(java.util.SortedMap<? extends K,? extends V> s)
s
- the Map whose elements are to be placed in the MapMethod Detail |
---|
public javax.swing.ListModel keyOrderedListModel()
DisplayableSortedMap
toString()
is what will actually be
displayed for each. The values will be displayed in the order of their
keys.
keyOrderedListModel
in interface DisplayableSortedMap<K,V>
public java.util.Comparator<? super K> comparator()
comparator
in interface java.util.SortedMap<K,V>
public K firstKey()
firstKey
in interface java.util.SortedMap<K,V>
public java.util.SortedMap<K,V> headMap(K toKey)
DisplayableSortedMap
headMap
in interface DisplayableSortedMap<K,V>
headMap
in interface java.util.SortedMap<K,V>
toKey
- - high endpoint (exclusive) of the headMap
public K lastKey()
lastKey
in interface java.util.SortedMap<K,V>
public java.util.SortedMap<K,V> subMap(K fromKey, K toKey)
DisplayableSortedMap
subMap
in interface DisplayableSortedMap<K,V>
subMap
in interface java.util.SortedMap<K,V>
fromKey
- - low endpoint (inclusive) of the subMap.toKey
- - high endpoint (exclusive) of the subMap.
public java.util.SortedMap<K,V> tailMap(K fromKey)
DisplayableSortedMap
tailMap
in interface DisplayableSortedMap<K,V>
tailMap
in interface java.util.SortedMap<K,V>
fromKey
- - low endpoint (inclusive) of the tailMap.
public javax.swing.ListModel listModel()
DisplayableMap
toString()
is what will actually be
displayed for each. There will be no necessary connection between
the order of display and any order in the map, since this
method can be invoked on any map implementing this interface. (The
method valueOrderedListModel
specified below can be used
with any map if it is desired to display the values in some order based
on their natural order or that induced by a specified comparator.
For maps having an inherent order of keys,
keyOrderedListModel
can also be used to display the values
in an order corresponding to the order of the keys.)
listModel
in interface DisplayableMap<K,V>
valueOrderedListModel()
in this interface and
keyOrderedListModel
in DisplayableSortedMap
public javax.swing.ListModel valueOrderedListModel()
DisplayableMap
toString()
is what will actually be
displayed for each. The values will be displayed in an order determined
by the natural order of the values
valueOrderedListModel
in interface DisplayableMap<K,V>
public javax.swing.ListModel valueOrderedListModel(java.util.Comparator<V> comparator)
DisplayableMap
toString()
is what will actually be
displayed for each. The values will be displayed in an order determined
by the specified comparator
valueOrderedListModel
in interface DisplayableMap<K,V>
comparator
- the comparator to usepublic void clear()
clear
in interface java.util.Map<K,V>
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<K,V>
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<K,V>
public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
DisplayableMap
entrySet
in interface DisplayableMap<K,V>
entrySet
in interface java.util.Map<K,V>
public boolean equals(java.lang.Object o)
equals
in interface java.util.Map<K,V>
equals
in class java.lang.Object
public V get(java.lang.Object key)
get
in interface java.util.Map<K,V>
public int hashCode()
hashCode
in interface java.util.Map<K,V>
hashCode
in class java.lang.Object
public boolean isEmpty()
isEmpty
in interface java.util.Map<K,V>
public java.util.Set<K> keySet()
DisplayableMap
keySet
in interface DisplayableMap<K,V>
keySet
in interface java.util.Map<K,V>
public V put(K key, V value)
put
in interface java.util.Map<K,V>
public void putAll(java.util.Map<? extends K,? extends V> t)
putAll
in interface java.util.Map<K,V>
public V remove(java.lang.Object key)
remove
in interface java.util.Map<K,V>
public int size()
size
in interface java.util.Map<K,V>
public java.util.Collection<V> values()
values
in interface DisplayableMap<K,V>
values
in interface java.util.Map<K,V>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |