- java.lang.Object
-
- org.hsqldb.map.BaseHashMap
-
- org.hsqldb.lib.OrderedLongKeyHashMap<V>
-
- All Implemented Interfaces:
Map<java.lang.Long,V>
public class OrderedLongKeyHashMap<V> extends org.hsqldb.map.BaseHashMap implements Map<java.lang.Long,V>
A Map of long 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:
- 1.9.0
- Author:
- Fred Toussi (fredt@users dot sourceforge.net)
-
-
Constructor Summary
Constructors Constructor Description OrderedLongKeyHashMap()
OrderedLongKeyHashMap(int initialCapacity)
OrderedLongKeyHashMap(int initialCapacity, boolean hasAdditionalValues)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(long key)
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
Set<Map.Entry<java.lang.Long,V>>
entrySet()
V
get(long key)
V
get(java.lang.Long key)
java.lang.Object
getFourthValueAt(int index)
int
getIndex(long key)
long
getKeyAt(int index)
int
getLookup(long key)
java.lang.Object
getSecondValueAt(int index)
java.lang.Object
getThirdValueAt(int index)
V
getValueAt(int index)
boolean
insert(int index, long key, V value)
Set<java.lang.Long>
keySet()
long[]
keysToArray(long[] array)
V
put(long key, V value)
V
put(java.lang.Long key, V value)
void
putAll(LongKeyHashMap<V> other)
V
remove(long key)
V
remove(java.lang.Object key)
void
removeEntry(int index)
boolean
set(int index, long key, V value)
java.lang.Object
setFourthValueAt(int index, java.lang.Object value)
boolean
setKeyAt(int index, long key)
java.lang.Object
setSecondValueAt(int index, java.lang.Object value)
java.lang.Object
setThirdValueAt(int index, java.lang.Object value)
V
setValueAt(int index, V value)
Collection<V>
values()
java.lang.Object[]
valuesToArray()
<T> T[]
valuesToArray(T[] array)
-
-
-
Constructor Detail
-
OrderedLongKeyHashMap
public OrderedLongKeyHashMap()
-
OrderedLongKeyHashMap
public OrderedLongKeyHashMap(int initialCapacity) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
OrderedLongKeyHashMap
public OrderedLongKeyHashMap(int initialCapacity, boolean hasAdditionalValues) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
-
Method Detail
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfaceMap<java.lang.Long,V>
-
containsKey
public boolean containsKey(long key)
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue
in interfaceMap<java.lang.Long,V>
-
get
public V get(long key)
-
getKeyAt
public long getKeyAt(int index)
-
getValueAt
public V getValueAt(int index)
-
getSecondValueAt
public java.lang.Object getSecondValueAt(int index)
-
getThirdValueAt
public java.lang.Object getThirdValueAt(int index)
-
getFourthValueAt
public java.lang.Object getFourthValueAt(int index)
-
setSecondValueAt
public java.lang.Object setSecondValueAt(int index, java.lang.Object value)
-
setThirdValueAt
public java.lang.Object setThirdValueAt(int index, java.lang.Object value)
-
setFourthValueAt
public java.lang.Object setFourthValueAt(int index, java.lang.Object value)
-
insert
public boolean insert(int index, long key, V value) throws java.lang.IndexOutOfBoundsException
- Throws:
java.lang.IndexOutOfBoundsException
-
set
public boolean set(int index, long key, V value) throws java.lang.IndexOutOfBoundsException
- Throws:
java.lang.IndexOutOfBoundsException
-
setKeyAt
public boolean setKeyAt(int index, long key) throws java.lang.IndexOutOfBoundsException
- Throws:
java.lang.IndexOutOfBoundsException
-
getIndex
public int getIndex(long key)
-
remove
public V remove(java.lang.Object key)
-
remove
public V remove(long key)
-
removeEntry
public void removeEntry(int index) throws java.lang.IndexOutOfBoundsException
- Throws:
java.lang.IndexOutOfBoundsException
-
getLookup
public int getLookup(long key)
-
putAll
public void putAll(LongKeyHashMap<V> other)
-
keysToArray
public long[] keysToArray(long[] array)
-
valuesToArray
public java.lang.Object[] valuesToArray()
-
valuesToArray
public <T> T[] valuesToArray(T[] array)
-
values
public Collection<V> values()
-
-