org.objectweb.telosys.common.data
Class DataRow

java.lang.Object
  extended byorg.objectweb.telosys.common.TelosysObject
      extended byorg.objectweb.telosys.common.data.DataRow
All Implemented Interfaces:
java.io.Serializable

public class DataRow
extends TelosysObject
implements java.io.Serializable

This class is a row composed of 1 to N cells of data
Each cell is indexed from 1 to N.

See Also:
Serialized Form

Constructor Summary
DataRow(int iSize)
          Create a DataRow with N columns
DataRow(int iSize, java.lang.Object[] values)
          Create a DataRow with N columns and populate it with the given values
 
Method Summary
 boolean getBoolean(int i)
          Return the boolean value of the given position
return false if null
 boolean getBoolean(int i, boolean valueIfNull)
          Return the boolean value of the given position
 byte getByte(int i)
          Return the byte value of the given position (return 0 if null)
 byte getByte(int i, byte valueIfNull)
          Return the byte value of the given position
 java.util.Date getDate(int i)
          Return the Date object of the given position (java.util.Date instance)
 double getDouble(int i)
          Return the double value of the given position (return 0 if null)
 double getDouble(int i, double valueIfNull)
          Return the double value of the given position
 float getFloat(int i)
          Return the float value of the given position (return 0 if null)
 float getFloat(int i, float valueIfNull)
          Return the float value of the given position
 int getInt(int i)
          Return the integer value of the given position (return 0 if null)
 int getInt(int i, int valueIfNull)
          Return the integer value of the given position
 long getLong(int i)
          Return the long value of the given position
 long getLong(int i, long valueIfNull)
          Return the long value of the given position
 java.lang.Object getObject(int i)
          Return the object stored at the given position
 short getShort(int i)
          Return the short value of the given position (return 0 if null)
 short getShort(int i, short valueIfNull)
          Return the short value of the given position
 int getSize()
          Return the size of the row (the number of cells)
ie : size = 3 for 3 cells (1 to 3)
 java.sql.Date getSqlDate(int i)
          Return the Date object of the given position (java.sql.Date instance)
 java.lang.String getString(int i)
          Return the String object stored at the given position
 java.lang.String getString(int i, java.lang.String valueIfNull)
          Return the String object stored at the given position
protected  void setObject(int i, java.lang.Object obj)
          Set a new object at the given column position ( 1 to N )
 java.lang.String toString()
           
 
Methods inherited from class org.objectweb.telosys.common.TelosysObject
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataRow

public DataRow(int iSize)
Create a DataRow with N columns

Parameters:
iSize - the row size (the number of columns)

DataRow

public DataRow(int iSize,
               java.lang.Object[] values)
Create a DataRow with N columns and populate it with the given values

Parameters:
iSize - the row size (the number of columns)
values - the values to populate the row cells ( standard Array : values from 0 to length-1 )
Method Detail

setObject

protected void setObject(int i,
                         java.lang.Object obj)
Set a new object at the given column position ( 1 to N )

Parameters:
i - the colum
obj -
Throws:
TelosysRuntimeException

toString

public java.lang.String toString()

getSize

public int getSize()
Return the size of the row (the number of cells)
ie : size = 3 for 3 cells (1 to 3)

Returns:

getObject

public java.lang.Object getObject(int i)
Return the object stored at the given position

Parameters:
i - position (1 to N)
Returns:
Throws:
TelosysRuntimeException

getString

public java.lang.String getString(int i)
Return the String object stored at the given position

Parameters:
i - position (1 to N)
Returns:
string instance (or null)
Throws:
TelosysRuntimeException

getString

public java.lang.String getString(int i,
                                  java.lang.String valueIfNull)
Return the String object stored at the given position

Parameters:
i - position (1 to N)
valueIfNull - the string to return if there's no object at the given position
Returns:
string instance
Throws:
TelosysRuntimeException

getBoolean

public boolean getBoolean(int i)
Return the boolean value of the given position
return false if null

Parameters:
i - position in the row (1 to N)
Returns:
Throws:
TelosysRuntimeException

getBoolean

public boolean getBoolean(int i,
                          boolean valueIfNull)
Return the boolean value of the given position

Parameters:
i - position in the row (1 to N)
valueIfNull - the value to return if there's no object at the given position
Returns:
Throws:
TelosysRuntimeException

getInt

public int getInt(int i)
Return the integer value of the given position (return 0 if null)

Parameters:
i - position in the row (1 to N)
Returns:
Throws:
TelosysRuntimeException

getInt

public int getInt(int i,
                  int valueIfNull)
Return the integer value of the given position

Parameters:
i - position in the row (1 to N)
valueIfNull - the value to return if there's no object at the given position
Returns:
Throws:
TelosysRuntimeException

getLong

public long getLong(int i)
Return the long value of the given position

Parameters:
i - position in the row (1 to N)
Returns:
the value ( 0 if null)
Throws:
TelosysRuntimeException

getLong

public long getLong(int i,
                    long valueIfNull)
Return the long value of the given position

Parameters:
i - position in the row (1 to N)
valueIfNull - the value to return if there's no object at the given position
Returns:
Throws:
TelosysRuntimeException

getShort

public short getShort(int i)
Return the short value of the given position (return 0 if null)

Parameters:
i - position in the row (1 to N)
Returns:
Throws:
TelosysRuntimeException

getShort

public short getShort(int i,
                      short valueIfNull)
Return the short value of the given position

Parameters:
i - position in the row (1 to N)
valueIfNull - the value to return if there's no object at the given position
Returns:
Throws:
TelosysRuntimeException

getByte

public byte getByte(int i)
Return the byte value of the given position (return 0 if null)

Parameters:
i - position in the row (1 to N)
Returns:
Throws:
TelosysRuntimeException

getByte

public byte getByte(int i,
                    byte valueIfNull)
Return the byte value of the given position

Parameters:
i - position in the row (1 to N)
valueIfNull - the value to return if there's no object at the given position
Returns:
Throws:
TelosysRuntimeException

getFloat

public float getFloat(int i)
Return the float value of the given position (return 0 if null)

Parameters:
i - position in the row (1 to N)
Returns:
Throws:
TelosysRuntimeException

getFloat

public float getFloat(int i,
                      float valueIfNull)
Return the float value of the given position

Parameters:
i - position in the row (1 to N)
valueIfNull - the value to return if there's no object at the given position
Returns:
Throws:
TelosysRuntimeException

getDouble

public double getDouble(int i)
Return the double value of the given position (return 0 if null)

Parameters:
i - position in the row (1 to N)
Returns:
Throws:
TelosysRuntimeException

getDouble

public double getDouble(int i,
                        double valueIfNull)
Return the double value of the given position

Parameters:
i - position in the row (1 to N)
valueIfNull - the value to return if there's no object at the given position
Returns:
Throws:
TelosysRuntimeException

getDate

public java.util.Date getDate(int i)
Return the Date object of the given position (java.util.Date instance)

Parameters:
i - position in the row (1 to N)
Returns:
Throws:
TelosysRuntimeException

getSqlDate

public java.sql.Date getSqlDate(int i)
Return the Date object of the given position (java.sql.Date instance)

Parameters:
i - position in the row (1 to N)
Returns:
Throws:
TelosysRuntimeException