com.sun.rowset.internal
Class BaseRow

java.lang.Object
  extended bycom.sun.rowset.internal.BaseRow
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
InsertRow, Row

public abstract class BaseRow
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

The abstract base class from which the classes Row The class BaseRow stores a row's original values as an array of Object values, which can be retrieved with the method getOrigRow. This class also provides methods for getting and setting individual values in the row.

A row's original values are the values it contained before it was last modified. For example, when the CachedRowSetmethod acceptChanges is called, it will reset a row's original values to be the row's current values. Then, when the row is modified, the values that were previously the current values will become the row's original values (the values the row had immediately before it was modified). If a row has not been modified, its original values are its initial values.

Subclasses of this class contain more specific details, such as the conditions under which an exception is thrown or the bounds for index parameters.

See Also:
Serialized Form

Field Summary
protected  java.lang.Object[] origVals
          The array containing the original values for this BaseRow object.
 
Constructor Summary
BaseRow()
           
 
Method Summary
abstract  java.lang.Object getColumnObject(int idx)
          Retrieves the array element at the given index, which is the original value of column number idx in this row.
 java.lang.Object[] getOrigRow()
          Retrieves the values that this row contained immediately prior to its last modification.
abstract  void setColumnObject(int idx, java.lang.Object obj)
          Sets the element at the given index into this row's array of original values to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

origVals

protected java.lang.Object[] origVals
The array containing the original values for this BaseRow object.

Constructor Detail

BaseRow

public BaseRow()
Method Detail

getOrigRow

public java.lang.Object[] getOrigRow()
Retrieves the values that this row contained immediately prior to its last modification.

Returns:
an array of Object values containing this row's original values

getColumnObject

public abstract java.lang.Object getColumnObject(int idx)
                                          throws java.sql.SQLException
Retrieves the array element at the given index, which is the original value of column number idx in this row.

Parameters:
idx - the index of the element to return
Returns:
the Object value at the given index into this row's array of original values
Throws:
SQLException - if there is an error
java.sql.SQLException

setColumnObject

public abstract void setColumnObject(int idx,
                                     java.lang.Object obj)
                              throws java.sql.SQLException
Sets the element at the given index into this row's array of original values to the given value. Implementations of the classes Row and determine what happens when the cursor is on the insert row and when it is on any other row.

Parameters:
idx - the index of the element to be set
obj - the Object to which the element at index idx to be set
Throws:
SQLException - if there is an error
java.sql.SQLException