net.sourceforge.sqlunit.beans
Class Row

java.lang.Object
  extended by net.sourceforge.sqlunit.beans.Row
All Implemented Interfaces:
java.lang.Comparable

public class Row
extends java.lang.Object
implements java.lang.Comparable

Models a row element, (wrapping multiple Col objects) in a database result.

Version:
$Revision: 1.5 $
Author:
Sujit Pal (spal@users.sourceforge.net)

Constructor Summary
Row()
           
 
Method Summary
 int compareTo(java.lang.Object obj)
          Returns a negative, zero or positive value depending on whether the contents of this column is less than, equal to or greater than the contents of the passed in Col object.
 Col getColById(java.lang.String colId)
          Convenience method to return a Col object by its id.
 Col[] getCols()
          Return an array of Col objects for this row.
 java.lang.String getId()
          Returns the Id for this row.
 boolean isPartial()
          Returns true if the row is partially specified.
 void setCols(Col[] columns)
          Set the Col object array for this row.
 void setId(java.lang.String rowId)
          Set the id for this row.
 void setPartial(java.lang.String partial)
          Sets whether the row is partially specified.
 void setSortCols(java.lang.String[] colIdsToSort)
          Sets a string array of ids to sort this row by.
 org.jdom.Element toElement()
          Returns a JDOM element that represents this Col object.
 java.lang.String toString()
          Returns the string representation of the Row bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Row

public Row()
Method Detail

getId

public final java.lang.String getId()
Returns the Id for this row.

Returns:
the id for this row.

setId

public final void setId(java.lang.String rowId)
Set the id for this row.

Parameters:
rowId - the id for this row.

isPartial

public final boolean isPartial()
Returns true if the row is partially specified.

Returns:
true if the row is partially specified.

setPartial

public final void setPartial(java.lang.String partial)
Sets whether the row is partially specified.

Parameters:
partial - "true" or "false", default is "false".

getCols

public final Col[] getCols()
Return an array of Col objects for this row.

Returns:
an array of Col objects for this row.

setCols

public final void setCols(Col[] columns)
Set the Col object array for this row. Also sets an internal Map of Col objects.

Parameters:
columns - an array of Col objects.

getColById

public final Col getColById(java.lang.String colId)
Convenience method to return a Col object by its id.

Parameters:
colId - the id of the Col object.
Returns:
a Col object for that id.

setSortCols

public final void setSortCols(java.lang.String[] colIdsToSort)
Sets a string array of ids to sort this row by.

Parameters:
colIdsToSort - a String array of column ids.

compareTo

public final int compareTo(java.lang.Object obj)
Returns a negative, zero or positive value depending on whether the contents of this column is less than, equal to or greater than the contents of the passed in Col object.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - an instance of a Col object.
Returns:
a negative, zero or positive number.

toElement

public final org.jdom.Element toElement()
Returns a JDOM element that represents this Col object.

Returns:
a JDOM element representing this object.

toString

public final java.lang.String toString()
Returns the string representation of the Row bean.

Overrides:
toString in class java.lang.Object
Returns:
the String representation of this bean.