|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap
org.openbp.common.util.OrderedMap
public class OrderedMap
Ordered map is a map which keeps the order of the incoming elements. It is based on a list and a map.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
| Constructor Summary | |
|---|---|
OrderedMap()
Constructor. |
|
OrderedMap(int initialCapacity)
Constructor. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears the map. |
java.lang.Object |
getKey(int index)
Gets a key by the index. |
java.lang.Object |
getLastKey()
Gets the last key. |
java.lang.Object |
getLastValue()
Gets the last value. |
java.lang.Object |
getValue(int index)
Gets a value by the index. |
int |
indexOf(java.lang.Object key)
Gets the index of an object. |
java.util.Set |
keySet()
Returns a set of all element keys in the correct order. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Adds an element to the map. |
java.lang.Object |
remove(java.lang.Object key)
Removes an element from the map. |
void |
removeLast()
Removes the last entry. |
java.util.Collection |
values()
Returns a collection of all element values in the correct order. |
| Methods inherited from class java.util.HashMap |
|---|
clone, containsKey, containsValue, entrySet, get, isEmpty, 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 |
| Constructor Detail |
|---|
public OrderedMap()
public OrderedMap(int initialCapacity)
initialCapacity - The initial capacity| Method Detail |
|---|
public java.lang.Object getValue(int index)
index - The index
public java.lang.Object getKey(int index)
index - The index
public int indexOf(java.lang.Object key)
key - The key object
public void removeLast()
public java.lang.Object getLastValue()
public java.lang.Object getLastKey()
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapput in class java.util.HashMapkey - Key of the element to addvalue - Element value
public java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mapremove in class java.util.HashMapkey - Key of the element to remove
public void clear()
clear in interface java.util.Mapclear in class java.util.HashMappublic java.util.Set keySet()
keySet in interface java.util.MapkeySet in class java.util.HashMappublic java.util.Collection values()
values in interface java.util.Mapvalues in class java.util.HashMap
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||