All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bea.jolt.pool.DataSet

java.lang.Object
   |
   +----java.util.Dictionary
           |
           +----java.util.Hashtable
                   |
                   +----bea.jolt.pool.DataSet

public class DataSet
extends Hashtable
This class contains data elements that contain the input or output parameters of a BEA TUXEDO service. The names of the elements in the data set must match exactly the names of the parameters used in the service. To access service parameters that have multiple occurrences, both the name of the element and its index should be used.

BEA TUXEDO services expect parameters to be of certain types. The following list shows the data types accepted by a BEA TUXEDO service and the Java classes that they map to.

 BEA TUXEDO       Java
 ----------------------
 char             Byte
 short            Short
 long             Integer
 float            Float
 double           Double
 char*            String
 CARRAY           byte[]
 
Each parameter value returned from a BEA TUXEDO service is always converted from its BEA TUXEDO data type to an instance of the corresponding Java class in the preceding list.

A parameter that is sent to a BEA TUXEDO service can either be an instance of the Java class corresponding to its BEA TUXEDO data type in the list above, or a String. If the parameter is a passed as a String, it is converted to the appropriate type for sending to the BEA TUXEDO service. Conversion is done according to the definition of the parameter in the BEA Jolt Repository. For conversion to be successful, the String must contain a meaningful value, such as "123.45" if the service parameter is a float. To pass CARRAY data as a String, represent the CARRAY (binary) data as a String of hexadecimal digits, such as "FF12EB0A".

Author:
Copyright (c) 1999 by BEA Systems, Inc. All Rights Reserved.

Constructor Index

 o DataSet()
Constructs a default DataSet with an initial capacity of ten elements
 o DataSet(int)
Constructs a DataSet with a specified initial capacity

Method Index

 o getCount(String)
Gets the number of occurrences of the data element with the specified name.
 o getValue(String, int, Object)
Gets the data element associated with the specified name and index.
 o getValue(String, Object)
Gets the data element associated with the specified name.
 o setValue(String, int, Object)
Sets the value of a data element associated with the specified name and index.
 o setValue(String, Object)
Sets the value of a data element associated with the specified name.

Constructors

 o DataSet
 public DataSet()
Constructs a default DataSet with an initial capacity of ten elements

 o DataSet
 public DataSet(int initCapacity)
Constructs a DataSet with a specified initial capacity

Parameters:
initCapacity - Initial capacity

Methods

 o getValue
 public Object getValue(String name,
                        int index,
                        Object defval)
Gets the data element associated with the specified name and index. Returns an Object that should be cast to the appropriate type depending on the BEA TUXEDO service definition. The following code handles a return parameter called "BALANCE", that is of type float:
 Float balance = (Float) getValue ("BALANCE", 0, null);
 

Parameters:
name - Name of the data element
index - Index of the data element, starting from 0
defval - Default value to return if the data element does not exist
Returns:
Data element or the default value
See Also:
getValue
 o getValue
 public Object getValue(String name,
                        Object defval)
Gets the data element associated with the specified name. This is equivalent to calling the getValue(name, index, defval) method with an index of zero.

Parameters:
name - Name of the data element
defval - Default value to return if the data element does not exist
Returns:
Data element or the default value
See Also:
getValue
 o setValue
 public void setValue(String name,
                      int index,
                      Object value)
Sets the value of a data element associated with the specified name and index. The value parameter must be one of the following types: String, Short, Integer, Float, Double, Byte or byte[]. The Java class of value must be consistent with the definition of the parameter in the BEA Jolt Repository, or it must be a String value. If value is given in String format, data conversion of the parameter is performed (using the service definition retrieved from the BEA Jolt Repository) before the BEA TUXEDO service is invoked.

The following code shows how to set the value of a service parameter called "ACCOUNT_ID".

This sample shows a value passed as an Integer (long in BEA TUXEDO).

 DataSet dataset = new DataSet();
 Integer val = new Integer(10);
 dataset.setValue("ACCOUNT_ID", 0, val);
 
The value of the parameter could also be passed as a String.
 DataSet dataset = new DataSet();
 String val = "10"; // This is a valid integer representation
 dataset.setValue("ACCOUNT_ID", 0, val);
 

Parameters:
name - Name of the data element
index - Occurrence index of the data element, starting from zero
value - Data element
See Also:
setValue
 o setValue
 public void setValue(String name,
                      Object value)
Sets the value of a data element associated with the specified name. This is equivalent to calling the setValue(name, index, value) method with an index of zero.

Parameters:
name - Name of the data element
value - String value for the data element
See Also:
setValue
 o getCount
 public int getCount(String name)
Gets the number of occurrences of the data element with the specified name.

Parameters:
name - Name of the data element
Returns:
Number of occurrences of the data element

All Packages  Class Hierarchy  This Package  Previous  Next  Index