com.sun.rowset.internal
Class InsertRow
java.lang.Object
com.sun.rowset.internal.BaseRow
com.sun.rowset.internal.InsertRow
-
All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
-
public class InsertRow
- extends BaseRow
- implements java.io.Serializable, java.lang.Cloneable
A class used internally to manage a CachedRowSet
object's insert row. This class keeps track of the number of columns in the insert row and which columns have had a value inserted. It provides methods for retrieving a column value, setting a column value, and finding out whether the insert row is complete.
-
See Also:
-
Serialized Form
Constructor Summary |
InsertRow(int numCols)
Creates an InsertRow object initialized with the given number of columns, an array for keeping track of the original values in this insert row, and a BitSet object with the same number of bits as there are columns. |
Method Summary |
java.lang.Object | getColumnObject(int idx)
Retrieves the value of the designated column in this InsertRow object. |
void | initInsertRow()
Clears all the bits in the internal BitSet object maintained by this InsertRow object. |
boolean | isCompleteRow(RowSetMetaData RowSetMD)
Indicates whether this InsertRow object has a value for every column that cannot be null. |
protected void | markColInserted(int col)
Sets the bit in this InsertRow object's internal BitSet object that corresponds to the specified column in this InsertRow object. |
void | setColumnObject(int idx, java.lang.Object val)
Sets the element in this InsertRow object's internal array of original values that corresponds to the designated column with the given value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InsertRow
public InsertRow(int numCols)
- Creates an
InsertRow
object initialized with the given number of columns, an array for keeping track of the original values in this insert row, and a BitSet
object with the same number of bits as there are columns.
-
Parameters:
-
numCols
- an int
indicating the number of columns in this InsertRow
object
markColInserted
protected void markColInserted(int col)
- Sets the bit in this
InsertRow
object's internal BitSet
object that corresponds to the specified column in this InsertRow
object. Setting a bit indicates that a value has been set.
-
-
-
Parameters:
-
col
- the number of the column to be marked as inserted; the first column is 1
isCompleteRow
public boolean isCompleteRow(RowSetMetaData RowSetMD)
throws SQLException
- Indicates whether this
InsertRow
object has a value for every column that cannot be null.
-
-
-
Parameters:
-
RowSetMD
- the RowSetMetaData
object for the CachedRowSet
object that maintains this InsertRow
object
-
Returns:
-
true
if this InsertRow
object is complete; false
otherwise
-
Throws:
-
SQLException
- if there is an error accessing data
initInsertRow
public void initInsertRow()
- Clears all the bits in the internal
BitSet
object maintained by this InsertRow
object. Clearing all the bits indicates that none of the columns have had a value inserted.
-
-
getColumnObject
public java.lang.Object getColumnObject(int idx)
throws SQLException
- Retrieves the value of the designated column in this
InsertRow
object. If no value has been inserted into the designated column, this method throws an SQLException
.
-
-
Specified by:
-
getColumnObject
in class BaseRow
-
-
Parameters:
-
idx
- the column number of the value to be retrieved; the first column is 1
-
Returns:
- the
Object
value at the given index into this row's array of original values
-
Throws:
-
SQLException
- if no value has been inserted into the designated column
setColumnObject
public void setColumnObject(int idx,
java.lang.Object val)
- Sets the element in this
InsertRow
object's internal array of original values that corresponds to the designated column with the given value. If the third argument is true
, which means that the cursor is on the insert row, this InsertRow
object's internal BitSet
object is set so that the bit corresponding to the column being set is turned on.
-
-
Specified by:
-
setColumnObject
in class BaseRow
-
-
Parameters:
-
idx
- the number of the column in the insert row to be set; the first column is 1
-
val
- the value to be set
Java is a trademark or registered trademark of Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A All Rights Reserved.