Top Description Fields Constructors Methods
org.h2.value

public Class CaseInsensitiveMap<V>

extends HashMap<String, V>
Class Inheritance
Type Parameters
<V>
the value type
Imports
java.util.HashMap, org.h2.util.StringUtils

A hash map with a case-insensitive string key.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
CaseInsensitiveMap()

Creates new instance of case-insensitive map.

public
CaseInsensitiveMap(int
the initial capacity
initialCapacity
)

Creates new instance of case-insensitive map with specified initial capacity.

Method Summary

Modifier and TypeMethod and Description
public boolean
containsKey(Object
The key whose presence in this map is to be tested
key
)

Overrides java.util.HashMap.containsKey.

Implements java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key.

public V
get(Object
the key whose associated value is to be returned
key
)

Overrides java.util.HashMap.get.

Implements java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

public V
put(String
key with which the specified value is to be associated
key
,
V
value to be associated with the specified key
value
)

Overrides java.util.HashMap.put.

Implements java.util.Map.put.

Associates the specified value with the specified key in this map.

public V
putIfAbsent(String
key with which the specified value is to be associated
key
,
V
value to be associated with the specified key
value
)

Overrides java.util.HashMap.putIfAbsent.

Overrides default java.util.Map.putIfAbsent.

If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value (optional operation).

public V
remove(Object
key whose mapping is to be removed from the map
key
)

Overrides java.util.HashMap.remove.

Implements java.util.Map.remove.

Removes the mapping for the specified key from this map if present.

Inherited from java.util.HashMap:
clearclonecomputecomputeIfAbsentcomputeIfPresentcontainsValueentrySetforEachgetOrDefaultisEmptykeySetmergenewHashMapputAllremovereplacereplacereplaceAllsizevalues

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.HashMap.serialVersionUID.

Constructor Detail

CaseInsensitiveMapback to summary
public CaseInsensitiveMap()

Creates new instance of case-insensitive map.

CaseInsensitiveMapback to summary
public CaseInsensitiveMap(int initialCapacity)

Creates new instance of case-insensitive map with specified initial capacity.

Parameters
initialCapacity:int

the initial capacity

Method Detail

containsKeyback to summary
public boolean containsKey(Object key)

Overrides java.util.HashMap.containsKey.

Implements java.util.Map.containsKey.

Doc from java.util.HashMap.containsKey.

Returns true if this map contains a mapping for the specified key.

Parameters
key:Object

The key whose presence in this map is to be tested

Returns:boolean

true if this map contains a mapping for the specified key.

Annotations
@Override
getback to summary
public V get(Object key)

Overrides java.util.HashMap.get.

Implements java.util.Map.get.

Doc from java.util.HashMap.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that (key==null ? k==null : key.equals(k)), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

A return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.

Parameters
key:Object

Doc from java.util.Map.get.

the key whose associated value is to be returned

Returns:V

Doc from java.util.Map.get.

the value to which the specified key is mapped, or null if this map contains no mapping for the key

Annotations
@Override
putback to summary
public V put(String key, V value)

Overrides java.util.HashMap.put.

Implements java.util.Map.put.

Doc from java.util.HashMap.put.

Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.

Parameters
key:String

key with which the specified value is to be associated

value:V

value to be associated with the specified key

Returns:V

the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key.)

Annotations
@Override
putIfAbsentback to summary
public V putIfAbsent(String key, V value)

Overrides java.util.HashMap.putIfAbsent.

Overrides default java.util.Map.putIfAbsent.

Doc from java.util.Map.putIfAbsent.

If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value (optional operation).

Parameters
key:String

key with which the specified value is to be associated

value:V

value to be associated with the specified key

Returns:V

the previous value associated with the specified key, or null if there was no mapping for the key. (A null return can also indicate that the map previously associated null with the key, if the implementation supports null values.)

Annotations
@Override
removeback to summary
public V remove(Object key)

Overrides java.util.HashMap.remove.

Implements java.util.Map.remove.

Doc from java.util.HashMap.remove.

Removes the mapping for the specified key from this map if present.

Parameters
key:Object

key whose mapping is to be removed from the map

Returns:V

the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key.)

Annotations
@Override