com.ibm.ims.rds
Class ClientSegment

java.lang.Object
  |
  +--com.ibm.ims.rds.ClientSegment

public class ClientSegment
extends java.lang.Object


Constructor Summary
ClientSegment(byte[] ioArea, ClientTypeInfo[] clientTypeInfo, java.io.PrintWriter logWriter, int traceLevel)
           
 
Method Summary
protected  void clearWarnings()
          Insert the method's description here.
 java.math.BigDecimal getBigDecimal(int index)
          Returns the field indicated by the index as a BigDecimal.
 java.math.BigDecimal getBigDecimal(int index, int scale)
          Returns the field indicated by the index as a BigDecimal.
 java.math.BigDecimal getBigDecimal(java.lang.String fieldName)
          Returns the field specified by the parameter as a BigDecimal.
 java.math.BigDecimal getBigDecimal(java.lang.String fieldName, int scale)
          Returns the field specified by the parameter as a BigDecimal.
 boolean getBoolean(int index)
          Returns the field indicated by the index as a boolean.
 boolean getBoolean(java.lang.String fieldName)
          Returns the field specified by the parameter as a boolean.
 byte getByte(int index)
          Returns the field indicated by the index as a byte.
 byte getByte(java.lang.String fieldName)
          Returns the field specified by the parameter as a byte.
 byte[] getBytes()
          Return the raw byte array that represents this segment.
 byte[] getBytes(int index)
          Returns the field indicated by the index "as is" (ie; the raw bytes of the field).
 byte[] getBytes(java.lang.String fieldName)
          Returns the field specified by the parameter "as is" (ie; the raw bytes of the field).
 java.sql.Date getDate(int index)
          Returns the field indicated by the index as a java.sql.Date object.
 java.sql.Date getDate(java.lang.String fieldName)
          Returns the field specified by the parameter as a java.sql.Date object.
 java.lang.String getDefaultEncoding()
          Returns the default character encoding for this segment.
 double getDouble(int index)
          Returns the field indicated by the index as a double.
 double getDouble(java.lang.String fieldName)
          Returns the field specified by the parameter as a double.
 float getFloat(int index)
          Returns the field indicated by the index as a float.
 float getFloat(java.lang.String fieldName)
          Returns the field specified by the parameter as a float.
 int getInt(int index)
          Returns the field indicated by the index as an int.
 int getInt(java.lang.String fieldName)
          Returns the field specified by the parameter as an int.
 long getLong(int index)
          Returns the field indicated by the index as a long.
 long getLong(java.lang.String fieldName)
          Returns the field specified by the parameter as a long.
 short getShort(int index)
          Returns the field indicated by the index as a short.
 short getShort(java.lang.String fieldName)
          Returns the field specified by the parameter as a short.
 java.lang.String getString(int index)
          Returns the field indicated by the index as a String.
 java.lang.String getString(java.lang.String fieldName)
          Returns the field specified by the parameter as a String.
 java.sql.Time getTime(int index)
          Returns the field indicated by the index as a java.sql.Time object.
 java.sql.Time getTime(java.lang.String fieldName)
          Returns the field specified by the parameter as a java.sql.Time object.
 java.sql.Timestamp getTimestamp(int index)
          Returns the field indicated by the index as a java.sql.Timestamp object.
 java.sql.Timestamp getTimestamp(java.lang.String fieldName)
          Returns the field specified by the parameter as a java.sql.Timestamp object.
 ClientTypeInfo[] getTypeInfo()
          Returns an array of the ClientTypeInfo instances for this segment.
 ClientTypeInfo getTypeInfo(int index)
          Returns the ClientTypeInfo of the field specified by the index parameter.
 ClientTypeInfo getTypeInfo(java.lang.String fieldName)
          Returns the ClientTypeInfo of the field specified by the fieldName parameter.
protected  RDSWarning getWarnings()
          Insert the method's description here.
 void setDefaultEncoding(java.lang.String encoding)
          Sets the character encoding that all character data in the segment adheres to.
 void setIOArea(byte[] ioArea)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientSegment

public ClientSegment(byte[] ioArea,
                     ClientTypeInfo[] clientTypeInfo,
                     java.io.PrintWriter logWriter,
                     int traceLevel)
Method Detail

clearWarnings

protected void clearWarnings()
Insert the method's description here. Creation date: (05/08/2000 1:05:55 PM)

getBigDecimal

public java.math.BigDecimal getBigDecimal(int index)
                                   throws RDSException
Returns the field indicated by the index as a BigDecimal. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the one-based index of the desired field in the DLITypeInfo array
Returns:
the value of the field as a BigDecimal
Throws:
RDSException - if the conversion cannot be done

getBigDecimal

public java.math.BigDecimal getBigDecimal(int index,
                                          int scale)
                                   throws RDSException
Returns the field indicated by the index as a BigDecimal. The index parameter is the index of the desired field that was passed to the constructor in the DLITypeInfo array. The index is one based. For example, if the fields in the segment were added to the DLITypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the one-based index of the desired field in the DLITypeInfo array
scale - the number of digits to the right of the decimal
Returns:
the value of the field as a BigDecimal
Throws:
RDSException - if the conversion cannot be done

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String fieldName)
                                   throws RDSException
Returns the field specified by the parameter as a BigDecimal. The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
Returns:
BigDecimal the value of the field as a BigDecimal
Throws:
RDSException - if the field name is not found in the segment

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String fieldName,
                                          int scale)
                                   throws RDSException
Returns the field specified by the parameter as a BigDecimal. The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
scale - the number of digits to the right of the decimal
Returns:
BigDecimal the value of the field as a BigDecimal
Throws:
RDSException - if the field name is not found in the segment

getBoolean

public boolean getBoolean(int index)
                   throws RDSException
Returns the field indicated by the index as a boolean. The index parameter is the index of the desired field that was passed to the constructor in the ClientTypeInfo array. The index is one based. For example, if the fields in the segment were added to the ClientTypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the ClientTypeInfo array
Returns:
the value of the field as a boolean
Throws:
RDSException - if the conversion cannot be done

getBoolean

public boolean getBoolean(java.lang.String fieldName)
                   throws RDSException
Returns the field specified by the parameter as a boolean. The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
Returns:
boolean the value of the field as a boolean
Throws:
RDSException - if the field name is not found in the segment

getByte

public byte getByte(int index)
             throws RDSException
Returns the field indicated by the index as a byte. The index parameter is the index of the desired field that was passed to the constructor in the ClientTypeInfo array. The index is one based. For example, if the fields in the segment were added to the ClientTypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the one-based index of the desired field in the ClientTypeInfo array
Returns:
the value of the field as a byte
Throws:
RDSException - if the conversion cannot be done

getByte

public byte getByte(java.lang.String fieldName)
             throws RDSException
Returns the field specified by the parameter as a byte. The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
Returns:
byte the value of the field as a byte
Throws:
RDSException - if the field name is not found in the segment

getBytes

public byte[] getBytes()
Return the raw byte array that represents this segment.
Returns:
byte[]

getBytes

public byte[] getBytes(int index)
                throws RDSException
Returns the field indicated by the index "as is" (ie; the raw bytes of the field). The index parameter is the index of the desired field that was passed to the constructor in the ClientTypeInfo array. The index is one based. For example, if the fields in the segment were added to the ClientTypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the ClientTypeInfo array
Returns:
the raw bytes of the field as an array of bytes
Throws:
RDSException - if the conversion cannot be done

getBytes

public byte[] getBytes(java.lang.String fieldName)
                throws RDSException
Returns the field specified by the parameter "as is" (ie; the raw bytes of the field). The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
Returns:
byte[] the raw bytes of the field as a byte array
Throws:
RDSException - if the field name is not found in the segment

getDate

public java.sql.Date getDate(int index)
                      throws RDSException
Returns the field indicated by the index as a java.sql.Date object. The index parameter is the index of the desired field that was passed to the constructor in the ClientTypeInfo array. The index is one based. For example, if the fields in the segment were added to the ClientTypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the ClientTypeInfo array
Returns:
the value of the field as a java.sql.Date object
Throws:
RDSException - if the conversion cannot be done

getDate

public java.sql.Date getDate(java.lang.String fieldName)
                      throws RDSException
Returns the field specified by the parameter as a java.sql.Date object. The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
Returns:
Date the value of the field as a java.sql.Date object
Throws:
RDSException - if the field name is not found in the segment

getDefaultEncoding

public java.lang.String getDefaultEncoding()
Returns the default character encoding for this segment.
Returns:
java.lang.String

getDouble

public double getDouble(int index)
                 throws RDSException
Returns the field indicated by the index as a double. The index parameter is the index of the desired field that was passed to the constructor in the ClientTypeInfo array. The index is one based. For example, if the fields in the segment were added to the ClientTypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the ClientTypeInfo array
Returns:
the value of the field as a double
Throws:
RDSException - if the conversion cannot be done

getDouble

public double getDouble(java.lang.String fieldName)
                 throws RDSException
Returns the field specified by the parameter as a double. The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
Returns:
double the value of the field as a double
Throws:
RDSException - if the field name is not found in the segment

getFloat

public float getFloat(int index)
               throws RDSException
Returns the field indicated by the index as a float. The index parameter is the index of the desired field that was passed to the constructor in the ClientTypeInfo array. The index is one based. For example, if the fields in the segment were added to the ClientTypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the ClientTypeInfo array
Returns:
the value of the field as a float
Throws:
RDSException - if the conversion cannot be done

getFloat

public float getFloat(java.lang.String fieldName)
               throws RDSException
Returns the field specified by the parameter as a float. The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
Returns:
float the value of the field as a float
Throws:
RDSException - if the field name is not found in the segment

getInt

public int getInt(int index)
           throws RDSException
Returns the field indicated by the index as an int. The index parameter is the index of the desired field that was passed to the constructor in the ClientTypeInfo array. The index is one based. For example, if the fields in the segment were added to the ClientTypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the ClientTypeInfo array
Returns:
the value of the field as an int
Throws:
RDSException - if the conversion cannot be done

getInt

public int getInt(java.lang.String fieldName)
           throws RDSException
Returns the field specified by the parameter as an int. The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
Returns:
int the value of the field as an int
Throws:
RDSException - if the field name is not found in the segment

getLong

public long getLong(int index)
             throws RDSException
Returns the field indicated by the index as a long. The index parameter is the index of the desired field that was passed to the constructor in the ClientTypeInfo array. The index is one based. For example, if the fields in the segment were added to the ClientTypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the ClientTypeInfo array
Returns:
the value of the field as a long
Throws:
RDSException - if the conversion cannot be done

getLong

public long getLong(java.lang.String fieldName)
             throws RDSException
Returns the field specified by the parameter as a long. The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
Returns:
long the value of the field as a long
Throws:
RDSException - if the field name is not found in the segment

getShort

public short getShort(int index)
               throws RDSException
Returns the field indicated by the index as a short. The index parameter is the index of the desired field that was passed to the constructor in the ClientTypeInfo array. The index is one based. For example, if the fields in the segment were added to the ClientTypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the ClientTypeInfo array
Returns:
the value of the field as a short
Throws:
RDSException - if the conversion cannot be done

getShort

public short getShort(java.lang.String fieldName)
               throws RDSException
Returns the field specified by the parameter as a short. The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
Returns:
short the value of the field as a short
Throws:
RDSException - if the field name is not found in the segment

getString

public java.lang.String getString(int index)
                           throws RDSException
Returns the field indicated by the index as a String. The index parameter is the index of the desired field that was passed to the constructor in the ClientTypeInfo array. The index is one based. For example, if the fields in the segment were added to the ClientTypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the ClientTypeInfo array
Returns:
the value of the field as a String
Throws:
RDSException - if the conversion cannot be done

getString

public java.lang.String getString(java.lang.String fieldName)
                           throws RDSException
Returns the field specified by the parameter as a String. The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
Returns:
String the value of the field as a String
Throws:
RDSException - if the field name is not found in the segment

getTime

public java.sql.Time getTime(int index)
                      throws RDSException
Returns the field indicated by the index as a java.sql.Time object. The index parameter is the index of the desired field that was passed to the constructor in the ClientTypeInfo array. The index is one based. For example, if the fields in the segment were added to the ClientTypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the ClientTypeInfo array
Returns:
the value of the field as a java.sql.Time object
Throws:
RDSException - if the conversion cannot be done

getTime

public java.sql.Time getTime(java.lang.String fieldName)
                      throws RDSException
Returns the field specified by the parameter as a java.sql.Time object. The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
Returns:
Time the value of the field as a java.sql.Time object
Throws:
RDSException - if the field name is not found in the segment

getTimestamp

public java.sql.Timestamp getTimestamp(int index)
                                throws RDSException
Returns the field indicated by the index as a java.sql.Timestamp object. The index parameter is the index of the desired field that was passed to the constructor in the ClientTypeInfo array. The index is one based. For example, if the fields in the segment were added to the ClientTypeInfo array in order, then the first field in the segment would be index 1, the second index 2, and so on.
Parameters:
index - the 1-based index of the desired field in the ClientTypeInfo array
Returns:
the value of the field as a java.sql.Timestamp object
Throws:
RDSException - if the conversion cannot be done

getTimestamp

public java.sql.Timestamp getTimestamp(java.lang.String fieldName)
                                throws RDSException
Returns the field specified by the parameter as a java.sql.Timestamp object. The fieldName parameter is the name of the field as it was registered in the ClientTypeInfo array.
Parameters:
fieldName - the name of the field as registered in the ClientTypeInfo array
Returns:
Timestamp the value of the field as a java.sql.Timestamp object
Throws:
RDSException - if the field name is not found in the segment

getTypeInfo

public ClientTypeInfo[] getTypeInfo()
Returns an array of the ClientTypeInfo instances for this segment.
Returns:
ClientTypeInfo[] the ClientTypeInfo array

getTypeInfo

public ClientTypeInfo getTypeInfo(int index)
Returns the ClientTypeInfo of the field specified by the index parameter.
Parameters:
index - the 1-based index of the desired field
Returns:
ClientTypeInfo the ClientTypeInfo of the specified field

getTypeInfo

public ClientTypeInfo getTypeInfo(java.lang.String fieldName)
                           throws RDSException
Returns the ClientTypeInfo of the field specified by the fieldName parameter. The fieldName parameter is the name given to the field when it was registered with this class's constructor.
Parameters:
index - the zero-based index of the desired field
Returns:
ClientTypeInfo the ClientTypeInfo of the specified field
Throws:
RDSException - if the field does not exist

getWarnings

protected RDSWarning getWarnings()
Insert the method's description here. Creation date: (03/01/2000 9:49:30 AM)
Returns:
java.sql.SQLWarning

setDefaultEncoding

public void setDefaultEncoding(java.lang.String encoding)
Sets the character encoding that all character data in the segment adheres to. This encoding can also be overridden on a per field basis.
Parameters:
encoding - the character encoding
See Also:
ClientTypeInfo

setIOArea

public void setIOArea(byte[] ioArea)


(C) International Business Machines Corporation 2004. All rights reserved.