Hilbert II - Version 0.03.04

org.qedeq.kernel.xml.parser
Class SimpleAttributes

java.lang.Object
  extended byorg.qedeq.kernel.xml.parser.SimpleAttributes

public class SimpleAttributes
extends Object

Value object that contains unsorted key value pairs. Both arguments are string type, but there are access methods for different data types. If the type conversion in not possible an appropriate RuntimeException is thrown.

With add(java.lang.String, java.lang.String) another key value pair is added. An IllegalArgumentException is thrown, if the key is already known.

Version:
$Revision: 1.15 $

Constructor Summary
SimpleAttributes()
           
 
Method Summary
 void add(String key, String value)
          Adds a key value pair.
 Boolean getBoolean(String key)
          Returns the value for a key as an Boolean.
 Date getDate(String key)
          Returns the value for a key as an Date.
 Integer getInteger(String key)
          Returns the value for a key as an Integer.
 String[] getKeySortedStringValues()
          Get the attribute values, sorted by their keys.
 String getString(String key)
          Returns the value for a key.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleAttributes

public SimpleAttributes()
Method Detail

add

public final void add(String key,
                      String value)
Adds a key value pair. This key must be still unknown.

Parameters:
key - Key.
value - Value, maybe null.

getString

public final String getString(String key)
Returns the value for a key. If the key dosn't exist null is returned.

Parameters:
key - Key.
Returns:
Associated value.

getInteger

public final Integer getInteger(String key)
Returns the value for a key as an Integer. If the key dosn't exist null is returned. If the value must be transformable into an Integer value.

Parameters:
key - Key.
Returns:
Associated value converted into an Integer.

getBoolean

public final Boolean getBoolean(String key)
Returns the value for a key as an Boolean. If the key dosn't exist null is returned. If the value must be transformable into an Boolean value.

Parameters:
key - Key.
Returns:
Associated value converted into an Boolean.

getDate

public final Date getDate(String key)
Returns the value for a key as an Date. If the key dosn't exist null is returned. If the value must be transformable into an Date value. The expected date format is "yyyy-MM-dd'T'HH:mm:ss".

Parameters:
key - Key.
Returns:
Associated value converted into an Date.

getKeySortedStringValues

public final String[] getKeySortedStringValues()
Get the attribute values, sorted by their keys.

Returns:
Key sorted string values.

toString

public String toString()

Hilbert II - Version 0.03.04

©left GNU General Public Licence
All Rights Reserved.