org.h2.util

## Class ValueHashMap<V>

- java.lang.Object
- - org.h2.util.HashBase
  - - org.h2.util.ValueHashMap<V>

Type Parameters:
  `V` - the value type

    public class ValueHashMap<V>
    extends HashBase

This hash map supports keys of type Value.

### Field Summary

### Fields inherited from class org.h2.util.HashBase

`deletedCount, len, level, mask, size, zeroKey`

### Constructor Summary

Constructors
Constructor and Description
`ValueHashMap()`

### Method Summary

Methods
`V` `get(Value key)` Get the value for this key.
`java.util.ArrayList<Value>` `keys()` Get the list of keys.
`static <T> ValueHashMap<T>` `newInstance()` Create a new value hash map.
`void` `put(Value key, V value)` Add or update a key value pair.
`protected void` `rehash(int newLevel)` Increase the size of the underlying table and re-distribute the elements.
`void` `remove(Value key)` Remove a key value pair.
`protected void` `reset(int newLevel)` Clear the map and reset the level to the specified value.
`java.util.ArrayList<V>` `values()` Get the list of values.

### Methods inherited from class org.h2.util.HashBase

`checkSizeRemove, getIndex, size`

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

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

### Constructor Detail

#### ValueHashMap

    public ValueHashMap()

### Method Detail

#### newInstance

    public static <T> ValueHashMap<T> newInstance()

Create a new value hash map.

Returns:
  the object

#### reset

    protected void reset(int newLevel)

Description copied from class: `HashBase`
Clear the map and reset the level to the specified value.

Overrides:
  `reset` in class `HashBase`
Parameters:
  `newLevel` - the new level

#### rehash

    protected void rehash(int newLevel)

Description copied from class: `HashBase`
Increase the size of the underlying table and re-distribute the elements.

Specified by:
  `rehash` in class `HashBase`
Parameters:
  `newLevel` - the new level

#### put

    public void put(Value key,
           V value)

Add or update a key value pair.

Parameters:
  `key` - the key
  `value` - the new value

#### remove

    public void remove(Value key)

Remove a key value pair.

Parameters:
  `key` - the key

#### get

    public V get(Value key)

Get the value for this key. This method returns null if the key was not found.

Parameters:
  `key` - the key
Returns:
  the value for the given key

#### keys

    public java.util.ArrayList<Value> keys()

Get the list of keys.

Returns:
  all keys

#### values

    public java.util.ArrayList<V> values()

Get the list of values.

Returns:
  all values