Top Description Constructors Methods
org.hsqldb.lib

public Class OrderedHashMap<K, V>

extends HashMap<K, V>
Class Inheritance

A Map 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.

This class does not store null keys.

Author
Fred Toussi (fredt@users dot sourceforge.net)
Since
1.7.2
Version
2.60

Constructor Summary

AccessConstructor and Description
public
public
OrderedHashMap(int initialCapacity)

Method Summary

Modifier and TypeMethod and Description
public boolean
add(K key, V value)

private void
checkRange(int i)

public V

Returns:

the value stored in the entry
get
(int
the index of the entry
index
)

Implements org.hsqldb.lib.Map.get.

Same as getValueAt(index).

public int
getIndex(K key)

public K

Returns:

the value stored in the entry
getKeyAt
(int
the index of the entry
index
)

Returns the key stored in the entry at index position.

public V

Returns:

the value stored in the entry
getValueAt
(int
the index of the entry
index
)

Returns the value stored in the entry at index position.

public boolean
insert(int index, K key, V value)

public V
public void
removeEntry(int index)

public boolean
set(int index, K key, V value)

public boolean
setKeyAt(int index, K key)

public V
setValueAt(int index, V value)

Inherited from org.hsqldb.lib.HashMap:
containsKeycontainsValueentrySetgetkeySetkeysToArrayputputAllremovevaluesvaluesToArray

Constructor Detail

OrderedHashMapback to summary
public OrderedHashMap()
OrderedHashMapback to summary
public OrderedHashMap(int initialCapacity) throws IllegalArgumentException

Method Detail

addback to summary
public boolean add(K key, V value)
checkRangeback to summary
private void checkRange(int i)
getback to summary
public V get(int index) throws IndexOutOfBoundsException

Implements org.hsqldb.lib.Map.get.

Same as getValueAt(index).

Parameters
index:int

the index of the entry

Returns:V

the value stored in the entry

Exceptions
IndexOutOfBoundsException:
for invalid argument
getIndexback to summary
public int getIndex(K key)
getKeyAtback to summary
public K getKeyAt(int index) throws IndexOutOfBoundsException

Returns the key stored in the entry at index position.

Parameters
index:int

the index of the entry

Returns:K

the value stored in the entry

Exceptions
IndexOutOfBoundsException:
for invalid argument
getValueAtback to summary
public V getValueAt(int index) throws IndexOutOfBoundsException

Returns the value stored in the entry at index position.

Parameters
index:int

the index of the entry

Returns:V

the value stored in the entry

Exceptions
IndexOutOfBoundsException:
for invalid argument
insertback to summary
public boolean insert(int index, K key, V value) throws IndexOutOfBoundsException
removeback to summary
public V remove(Object key)

Overrides org.hsqldb.lib.HashMap.remove.

Implements org.hsqldb.lib.Map.remove.

removeEntryback to summary
public void removeEntry(int index) throws IndexOutOfBoundsException
setback to summary
public boolean set(int index, K key, V value) throws IndexOutOfBoundsException
setKeyAtback to summary
public boolean setKeyAt(int index, K key) throws IndexOutOfBoundsException
setValueAtback to summary
public V setValueAt(int index, V value) throws IndexOutOfBoundsException