|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
displayablecollections.DisplayableHashMap<K,V>
public class DisplayableHashMap<K,V>
A DisplayableHashMap encapsulates a HashMap 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 | |
---|---|
DisplayableHashMap()
Constructs a new empty Map |
|
DisplayableHashMap(int initialCapacity)
Constructs a new empty Map with the specified initial capacity |
|
DisplayableHashMap(int initialCapacity,
float loadFactor)
Constructs a new empty Map with the specified initial capacity and load factor |
|
DisplayableHashMap(java.util.Map<? extends K,? extends V> m)
Constructs a new Map containing the mappings in the specified map |
Method Summary | |
---|---|
void |
clear()
|
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)
|
V |
get(java.lang.Object key)
|
int |
hashCode()
|
boolean |
isEmpty()
|
java.util.Set<K> |
keySet()
Returns a set view of the keys contained in this map. |
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()
|
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 |
Constructor Detail |
---|
public DisplayableHashMap()
public DisplayableHashMap(int initialCapacity)
initialCapacity
- the initial capacitypublic DisplayableHashMap(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacityloadFactor
- the load factorpublic DisplayableHashMap(java.util.Map<? extends K,? extends V> m)
m
- the Map whose mappings are to be placed in the MapMethod Detail |
---|
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 |