|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.rowset.internal.BaseRow
com.sun.rowset.internal.Row
A class that keeps track of a row's values. A Row
object
maintains an array of current column values and an array of original
column values, and it provides methods for getting and setting the
value of a column. It also keeps track of which columns have
changed and whether the change was a delete, insert, or update.
Note that column numbers for rowsets start at 1
,
whereas the first element of an array or bitset is 0
.
The argument for the method getColumnUpdated
refers to
the column number in the rowset (the first column is 1
);
the argument for setColumnUpdated
refers to the index
into the rowset's internal bitset (the first bit is 0
).
Field Summary |
Fields inherited from class com.sun.rowset.internal.BaseRow |
origVals |
Constructor Summary | |
Row(int numCols)
Creates a new Row object with the given number of columns. |
|
Row(int numCols,
java.lang.Object[] vals)
Creates a new Row object with the given number of columns
and with its array of original values initialized to the given array. |
Method Summary | |
void |
clearDeleted()
Sets the deleted field for this Row object to
false . |
void |
clearInserted()
Sets the inserted field for this Row object to
false . |
void |
clearUpdated()
Sets the updated field for this Row object to
false , sets all the column values in this Row
object's internal array of current values to null , and clears
all of the bits in the BitSet object maintained by this
Row object. |
java.lang.Object |
getColumnObject(int columnIndex)
Retrieves the column value stored in the designated column of this Row object. |
boolean |
getColUpdated(int idx)
Indicates whether the designated column of this Row object
has been changed. |
BaseRow |
getCurrentRow()
Returns the row on which the cursor is positioned. |
boolean |
getDeleted()
Retrieves the value of this Row object's deleted field,
which will be true if one or more of its columns has been
deleted. |
boolean |
getInserted()
Retrieves the value of this Row object's inserted field,
which will be true if this row has been inserted. |
boolean |
getUpdated()
Retrieves the value of this Row object's
updated field. |
void |
initColumnObject(int idx,
java.lang.Object val)
This method is called internally by the CachedRowSet.populate
methods. |
void |
moveCurrentToOrig()
Sets the column values in this Row object's internal
array of original values with the values in its internal array of
current values, sets all the values in this Row
object's internal array of current values to null ,
clears all the bits in this Row object's internal bitset,
and sets its updated field to false . |
void |
setColumnObject(int idx,
java.lang.Object val)
This method is called internally by the CachedRowSet.updateXXX
methods. |
void |
setDeleted()
Sets this Row object's deleted field
to true . |
void |
setInserted()
Sets the value of this Row object's inserted field
to true . |
void |
setUpdated()
Sets the updated field for this Row object to
true if one or more of its column values has been changed. |
Methods inherited from class com.sun.rowset.internal.BaseRow |
getOrigRow |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Row(int numCols)
Row
object with the given number of columns.
The newly-created row includes an array of original values,
an array for storing its current values, and a BitSet
object for keeping track of which column values have been changed.
public Row(int numCols, java.lang.Object[] vals)
Row
object with the given number of columns
and with its array of original values initialized to the given array.
The new Row
object also has an array for storing its
current values and a BitSet
object for keeping track
of which column values have been changed.
Method Detail |
public void initColumnObject(int idx, java.lang.Object val)
CachedRowSet.populate
methods.
idx
- the number of the column in this Row
object
that is to be set; the index of the first column is
1
val
- the new value to be setpublic void setColumnObject(int idx, java.lang.Object val)
CachedRowSet.updateXXX
methods.
setColumnObject
in class BaseRow
idx
- the number of the column in this Row
object
that is to be set; the index of the first column is
1
val
- the new value to be setpublic java.lang.Object getColumnObject(int columnIndex) throws java.sql.SQLException
Row
object.
getColumnObject
in class BaseRow
columnIndex
- the index of the column value to be retrieved;
the index of the first column is 1
Object
in the Java programming language that
represents the value stored in the designated column
java.sql.SQLException
- if there is a database access errorpublic boolean getColUpdated(int idx)
Row
object
has been changed.
idx
- the index into the BitSet
object maintained by
this Row
object to keep track of which column
values have been modified; the index of the first bit is
0
true
if the designated column value has been changed;
false
otherwisepublic void setDeleted()
Row
object's deleted
field
to true
.
getDeleted()
public boolean getDeleted()
Row
object's deleted
field,
which will be true
if one or more of its columns has been
deleted.
true
if a column value has been deleted; false
otherwisesetDeleted()
public void clearDeleted()
deleted
field for this Row
object to
false
.
public void setInserted()
Row
object's inserted
field
to true
.
getInserted()
public boolean getInserted()
Row
object's inserted
field,
which will be true
if this row has been inserted.
true
if this row has been inserted; false
otherwisesetInserted()
public void clearInserted()
inserted
field for this Row
object to
false
.
public boolean getUpdated()
Row
object's
updated
field.
true
if this Row
object has been
updated; false
if it has notsetUpdated()
public void setUpdated()
updated
field for this Row
object to
true
if one or more of its column values has been changed.
getUpdated()
public void clearUpdated()
updated
field for this Row
object to
false
, sets all the column values in this Row
object's internal array of current values to null
, and clears
all of the bits in the BitSet
object maintained by this
Row
object.
public void moveCurrentToOrig()
Row
object's internal
array of original values with the values in its internal array of
current values, sets all the values in this Row
object's internal array of current values to null
,
clears all the bits in this Row
object's internal bitset,
and sets its updated
field to false
.
This method is called internally by the CachedRowSet
method makeRowOriginal
.
public BaseRow getCurrentRow()
Row
object on which the CachedRowSet
implementation objects's cursor is positioned
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |