com.informix.util

## Class IfxMap<V>

- java.lang.Object
- - java.util.AbstractMap<K,V>
  - - java.util.HashMap<java.lang.String,V>
    - - com.informix.util.IfxMap<V>

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,V>

    public class IfxMap<V>
    extends java.util.HashMap<java.lang.String,V>

An Informix specialization of HashMap for use when working with JDBC type maps (for processing UDTs) and wanting to perform case-insensitive comparisons. Case-insensitivity is achieved by converting the key to its lower-case equivalent when modifying or searching the map.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class java.util.AbstractMap

`java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>`

### Field Summary

Fields
`protected boolean` `preserveCase`

### Constructor Summary

Constructors
Constructor and Description
`IfxMap(boolean preserveCase)` Constructor for a map that can be used to support Informix's DELIMIDENT feature for case-sensitive vs case-insensitive JDBC type maps.

### Method Summary

Methods
`java.lang.Object` `clone()` Overrides `HashMap.clone()` to ensure the case-sensitive nature of this map is preserved.
`boolean` `containsKey(java.lang.Object key)` Overrides `HashMap.containsKey(Object)` to perform a case-insensitive search of the keys of this map if it is not case-sensitive.
`V` `get(java.lang.Object key)` Overrides `HashMap.get(Object)` to perform a case-insensitive search of the keys if this map is not case-sensitive.
`boolean` `isCaseSensitive()`
`V` `put(java.lang.String key, V value)` Overrides `HashMap.put(Object, Object)` by converting the key to lower-case if this map is case-insensitive (i.e.
`void` `putAll(java.util.Map<? extends java.lang.String,? extends V> m)` Overrides `HashMap.putAll(Map)` by converting the keys of each entry in the specified map to lower-case if this map is case-insensitive (i.e.
`V` `remove(java.lang.Object key)` Overrides `HashMap.remove(Object)` by converting the key to lower-case if this map is case-insensitive (i.e.

### Methods inherited from class java.util.HashMap

`clear, containsValue, entrySet, isEmpty, keySet, size, values`

### Methods inherited from class java.util.AbstractMap

`equals, hashCode, toString`

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

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.util.Map

`equals, hashCode`

### Field Detail

#### preserveCase

    protected final boolean preserveCase

### Constructor Detail

#### IfxMap

    public IfxMap(boolean preserveCase)

Constructor for a map that can be used to support Informix's DELIMIDENT feature for case-sensitive vs case-insensitive JDBC type maps.

Parameters:
  `preserveCase` - if set to `true` the case all this map's keys are preserved, if `false` all keys are converting to lower-case when modifying or searching this map

### Method Detail

#### isCaseSensitive

    public boolean isCaseSensitive()

#### clone

    public java.lang.Object clone()

Overrides `HashMap.clone()` to ensure the case-sensitive nature of this map is preserved.

Overrides:
  `clone` in class `java.util.HashMap<java.lang.String,V>`
See Also:
  `HashMap.clone()`

#### containsKey

    public boolean containsKey(java.lang.Object key)

Overrides `HashMap.containsKey(Object)` to perform a case-insensitive search of the keys of this map if it is not case-sensitive. This is achieved by converting the key to lower-case before searching this map.

Specified by:
  `containsKey` in interface `java.util.Map<java.lang.String,V>`
Overrides:
  `containsKey` in class `java.util.HashMap<java.lang.String,V>`
See Also:
  `HashMap.containsKey(Object)`

#### get

    public V get(java.lang.Object key)

Overrides `HashMap.get(Object)` to perform a case-insensitive search of the keys if this map is not case-sensitive. This is achieved by converting the key to lower-case before searching this map.

Specified by:
  `get` in interface `java.util.Map<java.lang.String,V>`
Overrides:
  `get` in class `java.util.HashMap<java.lang.String,V>`
See Also:
  `HashMap.get(Object)`

#### put

    public V put(java.lang.String key,
        V value)

Overrides `HashMap.put(Object, Object)` by converting the key to lower-case if this map is case-insensitive (i.e. this map does not preserve the case of the keys) before putting the key-value pair into this map.

Specified by:
  `put` in interface `java.util.Map<java.lang.String,V>`
Overrides:
  `put` in class `java.util.HashMap<java.lang.String,V>`
See Also:
  `HashMap.put(Object, Object)`

#### putAll

    public void putAll(java.util.Map<? extends java.lang.String,? extends V> m)

Overrides `HashMap.putAll(Map)` by converting the keys of each entry in the specified map to lower-case if this map is case-insensitive (i.e. this map does not preserve the case of the keys) before putting the entry into this map.

Specified by:
  `putAll` in interface `java.util.Map<java.lang.String,V>`
Overrides:
  `putAll` in class `java.util.HashMap<java.lang.String,V>`
See Also:
  `HashMap.put(Object, Object)`

#### remove

    public V remove(java.lang.Object key)

Overrides `HashMap.remove(Object)` by converting the key to lower-case if this map is case-insensitive (i.e. this map does not preserve the case of the keys) before calling the remove method of the super class.

Specified by:
  `remove` in interface `java.util.Map<java.lang.String,V>`
Overrides:
  `remove` in class `java.util.HashMap<java.lang.String,V>`
See Also:
  `HashMap.put(Object, Object)`