|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractMap | +--java.util.TreeMap | +--util.VectorizedMap
VectorizedMap
is a sorted map that also keeps track of
the object's insertion order. You can get elements from this map
by their natural order (determined by compareTo) or by when they were
added to this map.
Cloneable
,
Serializable
,
SortedMap
, Serialized FormInner classes inherited from class java.util.Map |
Map.Entry |
Field Summary | |
protected Vector |
vContainer
A Vector to keep track of insertion order. |
Constructor Summary | |
VectorizedMap()
Creates a new VectorizedMap instance. |
|
VectorizedMap(Map m)
Creates a new VectorizedMap instance from an existing
map. |
Method Summary | |
void |
clear()
Removes all mappings from this map. |
Object |
elementAtByInsertionOrder(int i)
Returns the value of the key-value pair at the specified insertion index. |
boolean |
equals(Object o)
Compares the specified object with this map for equality. |
int |
indexOfKeyByInsertionOrder(Object oKey)
Returns the rank of the given key based on the order of insertion. |
Integer[] |
indexOfValueByInsertionOrder(Object oValue)
Returns an Integer array of all the ranks of the given value based on the order of insertion. |
Object |
keyAtByInsertionOrder(int i)
Returns the key of the key-value pair at the specified insertion index. |
Vector |
keysByInsertionOrder()
|
Object |
nextKeyByInsertionOrder(int iCurrent)
A convenience method that returns the next key of the key-value pair that comes after the given index based on the order of insertion. |
Object |
nextKeyByInsertionOrder(Object oCurrentKey)
A convenience method that returns the next key of the key-value pair that comes after the given key based on the order of insertion. |
Object |
put(Object oKey,
Object oValue)
Associates the specified value with the specified key in this map. |
void |
putAll(Map m)
This is an unsupported opertion, because a regular map does not maintain the insertion order of its elements. |
Object |
remove(Object oKey)
Removes the mapping for this key from this map if present. |
Object |
valueAtByInsertionOrder(int i)
Returns the value of the key-value pair at the specified insertion index. |
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 |
hashCode, isEmpty, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
hashCode, isEmpty |
Field Detail |
protected Vector vContainer
Constructor Detail |
public VectorizedMap()
VectorizedMap
instance.public VectorizedMap(Map m)
VectorizedMap
instance from an existing
map.
Warning: the order of entry of the initial map will not be preserved.m
- a Map
valueMethod Detail |
public Object put(Object oKey, Object oValue)
put
in class TreeMap
oKey
- key with which the specified value is to be associated.oValue
- value to be associated with the specified key.public Object remove(Object oKey)
remove
in class TreeMap
oKey
- key whose mapping is to be removed from the map.public void putAll(Map m)
putAll
in class TreeMap
m
- Mappings to be stored in this map.public void clear()
clear
in class TreeMap
public boolean equals(Object o)
equals
in class AbstractMap
o
- object to be compared for equality with this map.public Object keyAtByInsertionOrder(int i)
i
- the index of the desired keypublic Object valueAtByInsertionOrder(int i)
i
- the index of the desired valuepublic Object elementAtByInsertionOrder(int i)
i
- the index of the desired valuepublic int indexOfKeyByInsertionOrder(Object oKey)
oKey
- the key to check.public Integer[] indexOfValueByInsertionOrder(Object oValue)
oValue
- the value to check.public Object nextKeyByInsertionOrder(int iCurrent)
iCurrent
- the index of the the current key-value pair based on
the order of insertion.public Object nextKeyByInsertionOrder(Object oCurrentKey)
oCurrentKey
- the value the the current key-value pair based on
the order of insertion.public Vector keysByInsertionOrder()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |