org.inxar.affirm
Interface Data


public interface Data

The Data interface is the 'goal' object in that it is the carrier of information that has been successfully verified through the proclamation/affirmation methodology. It acts as a map. Any individial Datum may be accessed with the get() method. Additionally, getXXX() methods are defined for all the primitive types which act as shortcuts. It is expected that the user of the Data object (1) has set up affirmations appropriately and (2) knows their data well enough to decide where it is appropriate to use the shortcut methods. This is important since the primitive return value for an undefined key may mimic a real value since there is no concept of null with primitive types.


Method Summary
 java.util.Enumeration enumerator()
          Returns an enumeration over all the Datum objects in the set.
 Datum get(java.lang.Object key)
          Returns the Datum mapped to the given key.
 boolean getBoolean(java.lang.Object key)
          Returns the Datum mapped to the given key as a boolean.
 byte getByte(java.lang.Object key)
          Returns the Datum mapped to the given key as a byte.
 char getChar(java.lang.Object key)
          Returns the Datum mapped to the given key as a char.
 double getDouble(java.lang.Object key)
          Returns the Datum mapped to the given key as a double.
 float getFloat(java.lang.Object key)
          Returns the Datum mapped to the given key as a float.
 int getInt(java.lang.Object key)
          Returns the Datum mapped to the given key as an int.
 long getLong(java.lang.Object key)
          Returns the Datum mapped to the given key as a long.
 java.lang.Object getObject(java.lang.Object key)
          Returns the Datum mapped to the given key as an object.
 short getShort(java.lang.Object key)
          Returns the Datum mapped to the given key as a short.
 java.lang.String getString(java.lang.Object key)
          Returns the Datum mapped to the given key as a string.
 boolean isEmpty()
          Returns true if no mappings exist in this object, false otherwise.
 int size()
          Returns the number of key value mappings in the set.
 

Method Detail

enumerator

public java.util.Enumeration enumerator()
Returns an enumeration over all the Datum objects in the set.

get

public Datum get(java.lang.Object key)
Returns the Datum mapped to the given key.

getBoolean

public boolean getBoolean(java.lang.Object key)
Returns the Datum mapped to the given key as a boolean.
Returns:
the value under this key or false if no such key exists.

getByte

public byte getByte(java.lang.Object key)
Returns the Datum mapped to the given key as a byte.
Returns:
the value under this key or 0 if no such key exists.

getShort

public short getShort(java.lang.Object key)
Returns the Datum mapped to the given key as a short.
Returns:
the value under this key or 0 if no such key exists.

getInt

public int getInt(java.lang.Object key)
Returns the Datum mapped to the given key as an int.
Returns:
the value under this key or 0 if no such key exists.

getLong

public long getLong(java.lang.Object key)
Returns the Datum mapped to the given key as a long.
Returns:
the value under this key or 0 if no such key exists.

getFloat

public float getFloat(java.lang.Object key)
Returns the Datum mapped to the given key as a float.
Returns:
the value under this key or 0.0 if no such key exists.

getDouble

public double getDouble(java.lang.Object key)
Returns the Datum mapped to the given key as a double.
Returns:
the value under this key or 0.0 if no such key exists.

getChar

public char getChar(java.lang.Object key)
Returns the Datum mapped to the given key as a char.
Returns:
the value under this key or (char)0 if no such key exists.

getString

public java.lang.String getString(java.lang.Object key)
Returns the Datum mapped to the given key as a string.
Returns:
the value under this key or null if no such key exists.

getObject

public java.lang.Object getObject(java.lang.Object key)
Returns the Datum mapped to the given key as an object.
Returns:
the value under this key or null if no such key exists.

isEmpty

public boolean isEmpty()
Returns true if no mappings exist in this object, false otherwise.

size

public int size()
Returns the number of key value mappings in the set.