Module org.hsqldb
Package org.hsqldb.lib

## Class OrderedLongKeyHashMap<V>

- 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)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.hsqldb.lib.Map

      `Map.Entry<K,​V>`

  - ### Field Summary

    - ### Fields inherited from class org.hsqldb.map.BaseHashMap

      `ACCESS_MAX, emptyObjectArray`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `OrderedLongKeyHashMap()` |
    `OrderedLongKeyHashMap​(int initialCapacity)` |
    `OrderedLongKeyHashMap​(int initialCapacity, boolean hasThirdValue)` |

  - ### 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.Object key)` |
    `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 other)` |
    `void` | `putAll​(Map<? extends java.lang.Long,​? extends V> other)` |
    `V` | `remove​(long key)` |
    `V` | `remove​(java.lang.Object key)` |
    `void` | `removeEntry​(int index)` |
    `boolean` | `set​(int index, long key, V 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)` |
    `java.lang.Object` | `setValueAt​(int index, java.lang.Object value)` |
    `Collection<V>` | `values()` |
    `java.lang.Object[]` | `valuesToArray()` |
    `<T> T[]` | `valuesToArray​(T[] array)` |

    - ### Methods inherited from class org.hsqldb.map.BaseHashMap

      `clear, clone, isEmpty, size`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.hsqldb.lib.Map

      `clear, isEmpty, size`

- - ### Constructor Detail

    - #### OrderedLongKeyHashMap

          public OrderedLongKeyHashMap()

    - #### OrderedLongKeyHashMap

          public OrderedLongKeyHashMap​(int initialCapacity)
                                throws java.lang.IllegalArgumentException

      Throws:
        `java.lang.IllegalArgumentException`

    - #### OrderedLongKeyHashMap

          public OrderedLongKeyHashMap​(int initialCapacity,
                                       boolean hasThirdValue)
                                throws java.lang.IllegalArgumentException

      Throws:
        `java.lang.IllegalArgumentException`

  - ### Method Detail

    - #### containsKey

          public boolean containsKey​(java.lang.Object key)

      Specified by:
        `containsKey` in interface `Map<java.lang.Long,​V>`

    - #### containsKey

          public boolean containsKey​(long key)

    - #### containsValue

          public boolean containsValue​(java.lang.Object value)

      Specified by:
        `containsValue` in interface `Map<java.lang.Long,​V>`

    - #### get

          public V get​(java.lang.Object key)

      Specified by:
        `get` in interface `Map<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)

    - #### setValueAt

          public java.lang.Object setValueAt​(int index,
                                             java.lang.Object value)

    - #### setSecondValueAt

          public java.lang.Object setSecondValueAt​(int index,
                                                   java.lang.Object value)

    - #### setThirdValueAt

          public java.lang.Object setThirdValueAt​(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)

    - #### put

          public V put​(java.lang.Long key,
                       V value)

      Specified by:
        `put` in interface `Map<java.lang.Long,​V>`

    - #### put

          public V put​(long key,
                       V value)

    - #### remove

          public V remove​(java.lang.Object key)

      Specified by:
        `remove` in interface `Map<java.lang.Long,​V>`

    - #### 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​(Map<? extends java.lang.Long,​? extends V> other)

      Specified by:
        `putAll` in interface `Map<java.lang.Long,​V>`

    - #### putAll

          public void putAll​(LongKeyHashMap other)

    - #### keysToArray

          public long[] keysToArray​(long[] array)

    - #### valuesToArray

          public java.lang.Object[] valuesToArray()

    - #### valuesToArray

          public <T> T[] valuesToArray​(T[] array)

    - #### keySet

          public Set<java.lang.Long> keySet()

      Specified by:
        `keySet` in interface `Map<java.lang.Long,​V>`

    - #### values

          public Collection<V> values()

      Specified by:
        `values` in interface `Map<java.lang.Long,​V>`

    - #### entrySet

          public Set<Map.Entry<java.lang.Long,​V>> entrySet()

      Specified by:
        `entrySet` in interface `Map<java.lang.Long,​V>`