net.sourceforge.taverna.baclava
Class DataThingAdapter

java.lang.Object
  extended by net.sourceforge.taverna.baclava.DataThingAdapter

public class DataThingAdapter
extends java.lang.Object

This class is designed as a wrapper for inputmaps and output maps. Values that are typically stored in these maps are usually stored as DataThings. In order to make the code cleaner, this wrapper, insures that values inserted into these maps are inserted as DataThings. Last edited by $Author: sowen70 $

Version:
$Revision: 1.2 $
Author:
Mark

Constructor Summary
DataThingAdapter(java.util.Map map)
           
 
Method Summary
 java.lang.String[][] getArrayArray(java.lang.String key)
          This method gets a two-dimensional array out of the DataThing map.
 java.util.ArrayList getArrayList(java.lang.String key)
          This metod gets an ArrayList from the DataThing map.
 boolean getBoolean(java.lang.String key)
          This method gets a boolean value from the hashmap
 java.lang.Double getDouble(java.lang.String key)
           
 double getDoubleVal(java.lang.String key)
           
 java.awt.Image getImage(java.lang.String key)
           
 int getInt(java.lang.String key)
          This method gets an integer value from the DataThing map
 java.io.Serializable getSerializable(java.lang.String key)
          This method gets a Serializable object from the map.
 java.lang.String getString(java.lang.String key)
          This method gets a value out of the map and returns it as a string.
 java.lang.String[] getStringArray(java.lang.String key)
          This method gets an array of objects as a string array.
 void putArrayArray(java.lang.String key, java.lang.String[][] value)
          This method puts a two-dimensional array into the DataThing map.
 void putArrayList(java.lang.String key, java.util.ArrayList list)
          This method puts an ArrayList into the DataThing map
 void putBoolean(java.lang.String key, boolean value)
          This method puts a boolean value into the map.
 void putDouble(java.lang.String key, java.lang.Double db)
           
 void putImage(java.lang.String key, java.awt.Image img)
           
 void putInt(java.lang.String key, int value)
          This method puts an integer value into the DataThing map
 void putSerializable(java.lang.String key, java.io.Serializable obj)
          This method puts a Serializable object into the map.
 void putString(java.lang.String key, java.lang.String value)
          This method wraps the string value in a DataThing before storing it in the hashmap.
 void putStringArray(java.lang.String key, java.lang.String[] values)
          This method puts a string array into the DataThing map.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataThingAdapter

public DataThingAdapter(java.util.Map map)
Method Detail

getString

public java.lang.String getString(java.lang.String key)
This method gets a value out of the map and returns it as a string. It performs the DataThing conversion for you.

Parameters:
key -
Returns:

getStringArray

public java.lang.String[] getStringArray(java.lang.String key)
This method gets an array of objects as a string array.

Parameters:
key -
Returns:

putString

public void putString(java.lang.String key,
                      java.lang.String value)
This method wraps the string value in a DataThing before storing it in the hashmap.

Parameters:
key - The key for the value.
value - The value to be stored.

putBoolean

public void putBoolean(java.lang.String key,
                       boolean value)
This method puts a boolean value into the map.

Parameters:
key -
value -

getBoolean

public boolean getBoolean(java.lang.String key)
This method gets a boolean value from the hashmap

Parameters:
key -
Returns:
False if null, otherwise returns the value indicated by the key.

putStringArray

public void putStringArray(java.lang.String key,
                           java.lang.String[] values)
This method puts a string array into the DataThing map.

Parameters:
key - The key for the value.
value - The values to be stored.

getInt

public int getInt(java.lang.String key)
This method gets an integer value from the DataThing map

Parameters:
key - The key for the value.
Returns:

putInt

public void putInt(java.lang.String key,
                   int value)
This method puts an integer value into the DataThing map

Parameters:
key - The key for the value.
value - The values to be stored.

getArrayArray

public java.lang.String[][] getArrayArray(java.lang.String key)
This method gets a two-dimensional array out of the DataThing map.

Parameters:
key -
Returns:

putArrayArray

public void putArrayArray(java.lang.String key,
                          java.lang.String[][] value)
This method puts a two-dimensional array into the DataThing map.

Parameters:
key -
value -

getArrayList

public java.util.ArrayList getArrayList(java.lang.String key)
This metod gets an ArrayList from the DataThing map.

Parameters:
key -
Returns:

putArrayList

public void putArrayList(java.lang.String key,
                         java.util.ArrayList list)
This method puts an ArrayList into the DataThing map

Parameters:
key -
list -

putSerializable

public void putSerializable(java.lang.String key,
                            java.io.Serializable obj)
This method puts a Serializable object into the map.

Parameters:
key -
obj -

getSerializable

public java.io.Serializable getSerializable(java.lang.String key)
This method gets a Serializable object from the map.

Parameters:
key -
Returns:

getImage

public java.awt.Image getImage(java.lang.String key)

putImage

public void putImage(java.lang.String key,
                     java.awt.Image img)

putDouble

public void putDouble(java.lang.String key,
                      java.lang.Double db)

getDouble

public java.lang.Double getDouble(java.lang.String key)

getDoubleVal

public double getDoubleVal(java.lang.String key)