monrovia.tools
Class ParameterMap

java.lang.Object
  |
  +--monrovia.tools.ParameterMap
All Implemented Interfaces:
java.io.Serializable

public class ParameterMap
extends java.lang.Object
implements java.io.Serializable

Parameter map with types and values.

See Also:
Serialized Form

Constructor Summary
ParameterMap()
          Constructor.
 
Method Summary
 void add(java.lang.String pKey, java.lang.Class pType)
          Add a key to this map.
 java.lang.Object get(java.lang.String pKey)
          Get parameter value.
 java.lang.Class getType(java.lang.String pKey)
          Get type for the given key.
 java.util.Map getValueMap()
          Get unmodifiable version of the value map.
 boolean isChanged()
          Returns true, if the values has been changed after last sync.
 java.lang.Object remove(java.lang.String pKey)
          Remove a key from this map.
 void reset()
          Set the stored values as the current ones and set the changed flag to false.
 void set(java.lang.String pKey, java.lang.Object pValue)
          Set value for a key.
 void sync()
          Set the current values as the stored ones and set the changed flag to false.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterMap

public ParameterMap()
Constructor.
Method Detail

add

public void add(java.lang.String pKey,
                java.lang.Class pType)
Add a key to this map.

Parameters:
pKey - the key to add
pType - type for the key

remove

public java.lang.Object remove(java.lang.String pKey)
Remove a key from this map.

Parameters:
pKey - the key to remove

getType

public java.lang.Class getType(java.lang.String pKey)
Get type for the given key.

Parameters:
pKey - the key
Returns:
the parameter or null, if there is no such parameter

set

public void set(java.lang.String pKey,
                java.lang.Object pValue)
Set value for a key. The key must already exist and the value must be instance of the type associated with the key.

Parameters:
pKey - the key to use
pValue - the value for the key

get

public java.lang.Object get(java.lang.String pKey)
Get parameter value.

Parameters:
the - the key to use
Returns:
the value or null

getValueMap

public java.util.Map getValueMap()
Get unmodifiable version of the value map.

sync

public void sync()
Set the current values as the stored ones and set the changed flag to false.

reset

public void reset()
Set the stored values as the current ones and set the changed flag to false.

isChanged

public boolean isChanged()
Returns true, if the values has been changed after last sync.