com.nec.tdd.tools.dbMapper
Class AttrValMap

java.lang.Object
  |
  +--com.nec.tdd.tools.dbMapper.AttrValMap

public class AttrValMap
extends java.lang.Object

A utility class provided with a variety of getter and putter methods for user convenience, to specify a collection of attribute name - value pairs (including basic attribyte types), used in DBInterface methods. put method is overloaded for various java primitive types.

Note:
Putter methods overwrite attribute value with same name.
Order of attribute value pairs is not preserved.


Field Summary
protected  java.util.HashMap map
          Hashmap which contains attribute value pairs (attribute name as key).
 
Constructor Summary
AttrValMap()
           
 
Method Summary
 boolean getBoolean(java.lang.String attrName)
          Gets the attribute value of designated attribute as boolean.
 byte getByte(java.lang.String attrName)
          Gets the attribute value of designated attribute as byte.
 char getChar(java.lang.String attrName)
          Gets the attribute value of designated attribute as character.
 double getDouble(java.lang.String attrName)
          Gets the attribute value of designated attribute as double.
 float getFloat(java.lang.String attrName)
          Gets the attribute value of designated attribute as float.
 int getInt(java.lang.String attrName)
          Gets the attribute value of designated attribute as integer.
 long getLong(java.lang.String attrName)
          Gets the attribute value of designated attribute as long.
 java.lang.Object getObject(java.lang.String attrName)
          Gets the attribute value of designated attribute as an Java object.
 short getShort(java.lang.String attrName)
          Gets the attribute value of designated attribute as short.
 java.lang.String getString(java.lang.String attrName)
          Gets the attribute value of designated attribute as string.
 void put(java.lang.String attrName, boolean value)
          Add a boolean attribute value indexed by attribute name.
 void put(java.lang.String attrName, byte value)
          Add a byte attribute value indexed by attribute name.
 void put(java.lang.String attrName, char value)
          Add a character attribute value indexed by attribute name.
 void put(java.lang.String attrName, double value)
          Add a double attribute value indexed by attribute name.
 void put(java.lang.String attrName, float value)
          Add a float attribute value indexed by attribute name.
 void put(java.lang.String attrName, int value)
          Add an integer attribute value indexed by attribute name.
 void put(java.lang.String attrName, long value)
          Add a long attribute value indexed by attribute name.
 void put(java.lang.String attrName, java.lang.Object value)
           
 void put(java.lang.String attrName, short value)
          Add a short attribute value indexed by attribute name.
 void put(java.lang.String attrName, java.lang.String value)
          Add a string attribute value indexed by attribute name.
 java.lang.Object remove(java.lang.String attrName)
          Removes the attribute with given name from this AttrValMap object.
 int size()
          Returns the number of attribute-value pairs stored in this map.
 java.lang.String toString()
          Returns string representation of AttrValMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

map

protected java.util.HashMap map
Hashmap which contains attribute value pairs (attribute name as key). Java primitives are automatically wrapped in equivalent class (i.e. int in java.lanag.Integer).
Constructor Detail

AttrValMap

public AttrValMap()
Method Detail

put

public void put(java.lang.String attrName,
                boolean value)
Add a boolean attribute value indexed by attribute name. Any old value with same attribute name, if any, is overwritten by new value.

put

public void put(java.lang.String attrName,
                int value)
Add an integer attribute value indexed by attribute name. Any old value with same attribute name, if any, is overwritten by new value.

put

public void put(java.lang.String attrName,
                short value)
Add a short attribute value indexed by attribute name. Any old value with same attribute name, if any, is overwritten by new value.

put

public void put(java.lang.String attrName,
                byte value)
Add a byte attribute value indexed by attribute name. Any old value with same attribute name, if any, is overwritten by new value.

put

public void put(java.lang.String attrName,
                char value)
Add a character attribute value indexed by attribute name. Any old value with same attribute name, if any, is overwritten by new value.

put

public void put(java.lang.String attrName,
                long value)
Add a long attribute value indexed by attribute name. Any old value with same attribute name, if any, is overwritten by new value.

put

public void put(java.lang.String attrName,
                float value)
Add a float attribute value indexed by attribute name. Any old value with same attribute name, if any, is overwritten by new value.

put

public void put(java.lang.String attrName,
                double value)
Add a double attribute value indexed by attribute name. Any old value with same attribute name, if any, is overwritten by new value.

put

public void put(java.lang.String attrName,
                java.lang.String value)
Add a string attribute value indexed by attribute name. Any old value with same attribute name, if any, is overwritten by new value.

put

public void put(java.lang.String attrName,
                java.lang.Object value)

getObject

public java.lang.Object getObject(java.lang.String attrName)
Gets the attribute value of designated attribute as an Java object.

getBoolean

public boolean getBoolean(java.lang.String attrName)
Gets the attribute value of designated attribute as boolean. ClassCastException is thrown if value is not of type boolean.

getInt

public int getInt(java.lang.String attrName)
Gets the attribute value of designated attribute as integer. ClassCastException is thrown if value is not of type int.

getShort

public short getShort(java.lang.String attrName)
Gets the attribute value of designated attribute as short. ClassCastException is thrown if value is not of type short.

getByte

public byte getByte(java.lang.String attrName)
Gets the attribute value of designated attribute as byte. ClassCastException is thrown if value is not of type byte.

getChar

public char getChar(java.lang.String attrName)
Gets the attribute value of designated attribute as character. ClassCastException is thrown if value is not of type character.

getLong

public long getLong(java.lang.String attrName)
Gets the attribute value of designated attribute as long. ClassCastException is thrown if value is not of type long.

getFloat

public float getFloat(java.lang.String attrName)
Gets the attribute value of designated attribute as float. ClassCastException is thrown if value is not of type float.

getDouble

public double getDouble(java.lang.String attrName)
Gets the attribute value of designated attribute as double. ClassCastException is thrown if value is not of type double.

getString

public java.lang.String getString(java.lang.String attrName)
Gets the attribute value of designated attribute as string. ClassCastException is thrown if value is not of type string.

size

public int size()
Returns the number of attribute-value pairs stored in this map.

remove

public java.lang.Object remove(java.lang.String attrName)
Removes the attribute with given name from this AttrValMap object.

toString

public java.lang.String toString()
Returns string representation of AttrValMap.
Overrides:
toString in class java.lang.Object