|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
ptolemy.actor.gt.data.TwoWayHashMap<K,V>
ptolemy.actor.gt.data.SequentialTwoWayHashMap<K,V>
K
- The key type.V
- The value type.public class SequentialTwoWayHashMap<K,V>
A two-way hash map where the keys are sorted. The keys are sorted in the order in which they are added to this two-way hash map.
Red (tfeng) |
Yellow (tfeng) |
Field Summary | |
---|---|
private java.util.List<K> |
_keySequence
The sequence of the keys, sorted in the order in which they are added to this two-way hash map. |
Constructor Summary | |
---|---|
SequentialTwoWayHashMap()
|
Method Summary | |
---|---|
void |
clear()
Clear this two-way hash map. |
java.lang.Object |
clone()
Clone this two-way hash map and return the clone. |
java.util.List<K> |
keys()
Return a sorted list of keys. |
V |
put(K key,
V value)
Put a value into this two-way hash map and associate it with a key. |
V |
remove(java.lang.Object key)
Remove the value associated with the given key. |
void |
removeLast()
Remove the value associated with the last key. |
void |
retain(int count)
Retain only the first count keys and their values, and remove the other keys and values. |
Methods inherited from class ptolemy.actor.gt.data.TwoWayHashMap |
---|
containsValue, getKey, values |
Methods inherited from class java.util.HashMap |
---|
containsKey, entrySet, get, isEmpty, keySet, putAll, size |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
private java.util.List<K> _keySequence
Constructor Detail |
---|
public SequentialTwoWayHashMap()
Method Detail |
---|
public void clear()
clear
in interface java.util.Map<K,V>
clear
in class TwoWayHashMap<K,V>
public java.lang.Object clone()
clone
in class TwoWayHashMap<K,V>
public java.util.List<K> keys()
public V put(K key, V value)
put
in interface java.util.Map<K,V>
put
in class TwoWayHashMap<K,V>
key
- The key.value
- The value.
public V remove(java.lang.Object key)
remove
in interface java.util.Map<K,V>
remove
in class TwoWayHashMap<K,V>
key
- The key.
public void removeLast()
public void retain(int count)
count
- The number of key-value pairs to be retained.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |