com.tivoli.twg.engine
Class TWGDbRow

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGDbRow
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
TWGDbStoreRow

public class TWGDbRow
extends java.lang.Object
implements java.io.Serializable

TWGDbRow encapsulates the column values for a table row or a query result row.

See Also:
Serialized Form

Constructor Summary
  TWGDbRow()
          Constructor for the row values
protected TWGDbRow(byte[] buf, int offset, int[] types)
          This method is public as an implementation side effect.
protected TWGDbRow(byte[] buf, int offset, int[] types, com.tivoli.twg.engine.TWGDbRowCache cache)
          This method is public as an implementation side effect.
  TWGDbRow(int size)
          Constructor for the TWGDbRow.
 
Method Summary
 void addColumnValue(double value)
          Add a double column value
 void addColumnValue(float value)
          Add a float column value
 void addColumnValue(int value)
          Add an integer column value
 void addColumnValue(long value)
          Add a long column value
 void addColumnValue(java.lang.Object value)
          Add an Object column value
 void addColumnValue(short value)
          Add a short column value
 void addColumnValue(java.lang.String value)
          Add a String column value
 int getBufferLen()
          This method is protected as an implementation side effect.
 int getNumValues()
          Get tne number of values in the row
 java.lang.Object getValueAt(int column_index)
          Get the value for particular column
 Vect getValues()
          Get the all the column values
protected  int initParmsByBuf(byte[] buf, int offset, int[] types)
          This method is public as an implementation side effect.
protected  int initParmsByBuf(byte[] buf, int offset, int[] types, com.tivoli.twg.engine.TWGDbRowCache cache)
          This method is public as an implementation side effect.
protected  int setBufferParms(byte[] buf, int offset, int[] types)
          This method is protected as an implementation side effect.
 void setColumnValue(double value, int index)
          This method is public as an implementation side effect.
 void setColumnValue(float value, int index)
          This method is public as an implementation side effect.
 void setColumnValue(int value, int index)
           
 void setColumnValue(long value, int index)
          This method is public as an implementation side effect.
 void setColumnValue(java.lang.Object value, int index)
           
 void setColumnValue(short value, int index)
           
 void setColumnValue(java.lang.String value, int index)
           
 java.lang.String toString()
          Convert row to String for debug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TWGDbRow

public TWGDbRow()
Constructor for the row values


TWGDbRow

public TWGDbRow(int size)
Constructor for the TWGDbRow.

Parameters:
size - - initial capacity.

TWGDbRow

protected TWGDbRow(byte[] buf,
                   int offset,
                   int[] types,
                   com.tivoli.twg.engine.TWGDbRowCache cache)
            throws TWGDbException
This method is public as an implementation side effect. Do not call or change. Its interface may be changed in a later release. Constructor that uses and intel byte bufffer format of the row as input

Parameters:
buf - - the buffer
offset - - offset into the buffer to start of row
types - - an array containing the data type for each value in the row
cache - - data cache for allocate data objects

TWGDbRow

protected TWGDbRow(byte[] buf,
                   int offset,
                   int[] types)
            throws TWGDbException
This method is public as an implementation side effect. Do not call or change. Its interface may be changed in a later release. Constructor that uses and intel byte bufffer format of the row as input

Parameters:
buf - - the buffer
offset - - offset into the buffer to start of row
types - - an array containing the data type for each value in the row
Method Detail

addColumnValue

public void addColumnValue(java.lang.Object value)
Add an Object column value

Parameters:
value - - the value

setColumnValue

public void setColumnValue(java.lang.Object value,
                           int index)

addColumnValue

public void addColumnValue(java.lang.String value)
Add a String column value

Parameters:
value - - the value

setColumnValue

public void setColumnValue(java.lang.String value,
                           int index)

addColumnValue

public void addColumnValue(int value)
Add an integer column value

Parameters:
value - - the value

setColumnValue

public void setColumnValue(int value,
                           int index)

addColumnValue

public void addColumnValue(short value)
Add a short column value

Parameters:
value - - the value

setColumnValue

public void setColumnValue(short value,
                           int index)

addColumnValue

public void addColumnValue(long value)
Add a long column value

Parameters:
value - - the value

setColumnValue

public void setColumnValue(long value,
                           int index)
This method is public as an implementation side effect. Do not call or change. Its interface may be changed in a later release.

Sets the value at the specified index of the this row to the specified value.

Parameters:
value - - the value
index - - the specified index starting from 1.

addColumnValue

public void addColumnValue(float value)
Add a float column value

Parameters:
value - - the value

setColumnValue

public void setColumnValue(float value,
                           int index)
This method is public as an implementation side effect. Do not call or change. Its interface may be changed in a later release.

Sets the value at the specified index of the this row to the specified value.

Parameters:
value - - the value
index - - the specified index starting from 1.

addColumnValue

public void addColumnValue(double value)
Add a double column value

Parameters:
value - - the value

setColumnValue

public void setColumnValue(double value,
                           int index)
This method is public as an implementation side effect. Do not call or change. Its interface may be changed in a later release.

Sets the value at the specified index of the this row to the specified value.

Parameters:
value - - the value
index - - the specified index starting from 1.

getNumValues

public int getNumValues()
Get tne number of values in the row

Returns:
- the number of value s

getValueAt

public java.lang.Object getValueAt(int column_index)
Get the value for particular column

Returns:
- the value as an Object

getValues

public Vect getValues()
Get the all the column values

Returns:
- a Vector of values

initParmsByBuf

protected int initParmsByBuf(byte[] buf,
                             int offset,
                             int[] types)
                      throws TWGDbException
This method is public as an implementation side effect. Do not call or change. Its interface may be changed in a later release. Method to initialize the parameters for the command using data from buffer.

Parameters:
buf - - byte array containing info about the row.
offset - - the offset in the buffer that the row starts at.
types - - int array containing the data type of each value in the row.
Returns:
int - new offset
Throws:
TWGDbException

initParmsByBuf

protected int initParmsByBuf(byte[] buf,
                             int offset,
                             int[] types,
                             com.tivoli.twg.engine.TWGDbRowCache cache)
                      throws TWGDbException
This method is public as an implementation side effect. Do not call or change. Its interface may be changed in a later release. Method to initialize the parameters for the command using data from buffer.

Parameters:
buf - - byte array containing info about the row.
offset - - the offset in the buffer that the row starts at.
types - - int array containing the data type of each value in the row.
cache - - data cache for duplicate data values
Returns:
int - new offset
Throws:
TWGDbException

setBufferParms

protected int setBufferParms(byte[] buf,
                             int offset,
                             int[] types)
                      throws TWGDbException
This method is protected as an implementation side effect. Do not call or change. Its interface may be changed in a later release. Method to write out the row values to an byte array buffer

Parameters:
buf - - byte array containing info about the row.
offset - - the offset in the buffer that the row starts at.
types - - int array containing the data type of each value in the row.
Returns:
int - new offset
Throws:
TWGDbException

getBufferLen

public int getBufferLen()
This method is protected as an implementation side effect. Do not call or change. Its interface may be changed in a later release. Get the length of the buffer required to store the row

Returns:
the length

toString

public java.lang.String toString()
Convert row to String for debug

Returns:
String with the values for each column in the row.