- java.lang.Object
-
- org.hsqldb.map.BaseHashMap
-
- org.hsqldb.lib.IntKeyHashMap<V>
-
- org.hsqldb.lib.OrderedIntKeyHashMap<V>
-
- All Implemented Interfaces:
Map<java.lang.Integer,V>
public class OrderedIntKeyHashMap<V> extends IntKeyHashMap<V> implements Map<java.lang.Integer,V>
A Map of int primitives to Object values which maintains the insertion order of the key/value pairs and allows access by index. Iterators return the keys or values in the index order.- Since:
- 2.0.0
- Author:
- Fred Toussi (fredt@users dot sourceforge.net)
-
-
Constructor Summary
Constructors Constructor Description OrderedIntKeyHashMap()
OrderedIntKeyHashMap(int initialCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getIndex(int key)
int
getKeyAt(int lookup, int def)
java.lang.Object
getValueAt(int index)
boolean
insert(int index, int key, V value)
V
remove(int key)
void
removeEntry(int index)
boolean
set(int index, int key, V value)
boolean
setKeyAt(int index, int key)
java.lang.Object
setValueAt(int index, java.lang.Object value)
-
Methods inherited from class org.hsqldb.lib.IntKeyHashMap
containsKey, containsKey, containsValue, entrySet, get, get, getKeyArray, getValueArray, keySet, keysToArray, put, put, putAll, remove, values, valuesToArray, valuesToArray
-
-
-
-
Method Detail
-
getKeyAt
public int getKeyAt(int lookup, int def)
-
getValueAt
public java.lang.Object getValueAt(int index)
-
setValueAt
public java.lang.Object setValueAt(int index, java.lang.Object value)
-
set
public boolean set(int index, int key, V value) throws java.lang.IndexOutOfBoundsException
- Throws:
java.lang.IndexOutOfBoundsException
-
insert
public boolean insert(int index, int key, V value) throws java.lang.IndexOutOfBoundsException
- Throws:
java.lang.IndexOutOfBoundsException
-
setKeyAt
public boolean setKeyAt(int index, int key) throws java.lang.IndexOutOfBoundsException
- Throws:
java.lang.IndexOutOfBoundsException
-
getIndex
public int getIndex(int key)
-
remove
public V remove(int key)
- Overrides:
remove
in classIntKeyHashMap<V>
-
removeEntry
public void removeEntry(int index) throws java.lang.IndexOutOfBoundsException
- Throws:
java.lang.IndexOutOfBoundsException
-
-