|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Map<K,V>
Collection interface representing set of key/value pairs.
Nested Class Summary | |
---|---|
static class |
Map.MapListenerList<K,V>
Map listener list. |
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Dictionary |
---|
Dictionary.Pair<K,V> |
Method Summary | |
---|---|
void |
clear()
Removes all entries in the map. |
int |
getCount()
Returns the number of entries in the map. |
ListenerList<MapListener<K,V>> |
getMapListeners()
Returns the map listener collection. |
V |
put(K key,
V value)
Sets the value of the given key, creating a new entry or replacing the existing value, and firing a corresponding event. |
V |
remove(K key)
Removes a key/value pair from the map. |
void |
setComparator(Comparator<K> comparator)
Sets the collection's sort order, re-ordering the collection's contents and ensuring that new entries preserve the sort order. |
Methods inherited from interface org.apache.pivot.collections.Dictionary |
---|
containsKey, get |
Methods inherited from interface org.apache.pivot.collections.Collection |
---|
getComparator, isEmpty |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Method Detail |
---|
V put(K key, V value)
put
in interface Dictionary<K,V>
key
- The key whose value is to be set.value
- The value to be associated with the given key.
MapListener.valueAdded(Map, Object)
,
MapListener.valueUpdated(Map, Object, Object)
V remove(K key)
Dictionary
remove
in interface Dictionary<K,V>
key
- The key whose mapping is to be removed.
MapListener.valueRemoved(Map, Object, Object)
void clear()
clear
in interface Collection<K>
MapListener.mapCleared(Map)
int getCount()
void setComparator(Comparator<K> comparator)
Collection
Calling this method more than once with the same comparator will re-sort the collection.
setComparator
in interface Collection<K>
comparator
- The comparator used to order elements in the collection, or null if the
collection is unsorted.MapListener.comparatorChanged(Map, Comparator)
ListenerList<MapListener<K,V>> getMapListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |