pt.jcodeutil.core.sql
Class DataSet.DataRow

java.lang.Object
  |
  +--pt.jcodeutil.core.sql.DataSet.DataRow
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
DataSet

protected class DataSet.DataRow
extends java.lang.Object
implements java.io.Serializable

Class that contains the information about one row of data.

Title: JCodeUtil

Description:

Version:
1.0
Author:
Marco Samuel (samuelbb@sapo.pt)
See Also:
Serialized Form

Constructor Summary
DataSet.DataRow(int elements)
          Creates a new DataSet for the number of columns specified
 
Method Summary
 void addRow(java.lang.String name, java.lang.String value)
          Adds a new row in the DataSet
 void clear()
          Clears this DataRow.
 java.lang.String getName(int pos)
          Gets the name for the specified position.
 java.lang.String[] getNames()
          Get the names of the data.
 int getPosByName(java.lang.String name)
          Gets the position of a named column
 java.lang.String getValue(java.lang.String name)
          Gets the value for the specified column name.
 java.lang.String getValueByPos(int pos)
          Gets the value in the specified position.
 java.lang.String[] getValues()
          Get the values of the data.
 void resetValue(int pos, java.lang.String value)
          Changes the value in a column
 void resetValue(java.lang.String name, java.lang.String value)
          Changes the value in a column.
 void setAllNullsAsEmptyStrings()
          Replaces all columns with value == null with Empty String
 int size()
          Get the size of the row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSet.DataRow

public DataSet.DataRow(int elements)
Creates a new DataSet for the number of columns specified
Parameters:
elements - Number of columns in the DataSet
Method Detail

getNames

public java.lang.String[] getNames()
Get the names of the data.
Returns:
the names of the data.

getValues

public java.lang.String[] getValues()
Get the values of the data.
Returns:
the values of the data.

addRow

public void addRow(java.lang.String name,
                   java.lang.String value)
Adds a new row in the DataSet
Parameters:
name - Name of the column
value - Value in the column

size

public int size()
Get the size of the row.
Returns:
The size of this DataRow.

getValue

public java.lang.String getValue(java.lang.String name)
Gets the value for the specified column name.
Parameters:
name - Name of the column.
Returns:
The value in the specified column name.

resetValue

public void resetValue(java.lang.String name,
                       java.lang.String value)
Changes the value in a column.
Parameters:
name - Name of the column to change it's value.
value - New value for the column.

resetValue

public void resetValue(int pos,
                       java.lang.String value)
Changes the value in a column
Parameters:
pos - Position to change the value
value - New value for the column
Returns:
True if the value was successfully changed

getPosByName

public int getPosByName(java.lang.String name)
Gets the position of a named column
Parameters:
name - Name of the column to find
Returns:
The position for the named column

getValueByPos

public java.lang.String getValueByPos(int pos)
Gets the value in the specified position.
Returns:
The value in the specified position; null in case of error.

getName

public java.lang.String getName(int pos)
Gets the name for the specified position.
Parameters:
pos - Position.
Returns:
Returns the name in the specified position, null if the name doesn't exists.

clear

public void clear()
Clears this DataRow.

setAllNullsAsEmptyStrings

public void setAllNullsAsEmptyStrings()
Replaces all columns with value == null with Empty String