borland Packages Class Hierarchy dx.dataset Package
java.lang.Object +----com.borland.dx.dataset.ReadRow +----com.borland.dx.dataset.ReadWriteRow +----com.borland.dx.dataset.FilterRow +----com.borland.dx.dataset.InternalRow
Properties Methods
Implements Serializable
The ReadRow
class provides read access to a row of data. It has methods to read values from a single
Column
according to its data type, as well as methods to
read the value from a Column
of any data type into a Variant
. It also has methods to compare or
copy an entire row or a subset of its columns to another row.
The ReadRow
class is extended by ReadWriteRow
, which provides similar methods to write values
to Columns
. The ReadWriteRow
class is in turn extended by DataSet
, DataRow
, and
ParameterRow
. These three classes all use the read and write methods in ReadRow
and
ReadWriteRow
heavily to manipulate Column
values.
You can use the equals()
, findDifference()
, and copyTo()
methods to compare two
rows from the same or different data sets, or to copy rows from one data set to another.
public final int getColumnCount()Read-only property that returns the count of
Column
components.
public Column[] getColumns()Read-only property that returns an array of columns. This property is used by the JBuilder design tools.
public void copyTo(ReadWriteRow destRow)Copies the row values from this row to
destRow
.
The copy is not performed for destination Columns
that are readOnly; no Exception
is generated.
If the Column
components of the destRow
are not from the same DataSet
, columns with the same name are copied, assuming the data types of the columns
match.
If this ReadRow
does not have columns with the same type and name as all columns in
destRow
, a DataSetException
is thrown.
Call this method when this ReadRow
and the destination destRow
are identical, or
when the columns of the ReadRow
are a subset of those in the destRow
.
If the structure of this ReadRow
component is not similar to that of the destRow
, call the
copyTo(String[], ReadRow, String[], ReadWriteRow)
method instead.
public static void copyTo(String[] sourceNames, ReadRow sourceRow, String[] destNames, ReadWriteRow destRow)Copies values of the
ReadRow
to a ReadWriteRow
, given an array of source and destination names.
If a destination Column
is readOnly
, the copy is not performed for that column; no Exception
is generated.
Use this method when the structure of this ReadRow
is not identical to that of the destRow
, to
specify which Columns
of the ReadRow
get copied to which Columns
in the destRow
.
public final boolean equals(ReadRow compareRow)Returns true if the values of columns in
compareRow
are equal to the column
values in this row that have the same name. The compareRow
parameter may be a scoped row
containing a subset of the columns in this row. If this row does not have columns with the same name and
type as all columns in compareRow
, a DataSetException
is thrown.
public final int findDifference(int startOrdinal, ReadRow compareRow)Returns the ordinal of the first column value that differs between this row and
compareRow
starting
from startOrdinal
. If there are no more differences, -1 is returned. On error, this method throws a
DataSetException
.
public final int findModified(int startOrdinal)Returns the ordinal of the first column value that has been modified. If there are no more modified columns after
startOrdinal,
-1 is returned.
public final int findOrdinal(String columnName)Returns the ordinal of the column specified in
columnName
. This method is slightly more performant than hasColumn
if there is a good chance the column does not exist.
public final String format(int ordinal)Returns the
String
representation of the value at the ordinal position using a Column
formatter. On error, this method throws a DataSetException
.
public final String format(String columnName)Returns a
String
representation of the value at the specified column name, using a Column
formatter.
public final int getArrayLength(String columnName)Returns the length of the BYTE_ARRAY. On error, this method throws a
DataSetException
.
public final BigDecimal getBigDecimal(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as a BigDecimal
. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.BIGDECIMAL
.
getBigDecimal(java.lang.String)
public final BigDecimal getBigDecimal(String columnName)Returns the value in the
Column
named columnName
as a BigDecimal
. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not Variant.BIGDECIMAL
.
This method is typically preferred over getBigDecimal(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns, columns that are automatically added to a query to provide a unique row identifier, and other conditions. Note that ordinal access can be slightly faster, especially for DataSets
with more than 20 columns.
public final InputStream getBinaryStream(int ordinal)This method has been deprecated. Use
getInputStream(int)
.
public final boolean getBoolean(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as a boolean. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.BOOLEAN
.
getBoolean(java.lang.String)
public final boolean getBoolean(String columnName)Returns the value in the
Column
named columnName
as a boolean. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not Variant.BOOLEAN
.
This method is typically preferred over getBoolean(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns, columns that are automatically added to a query to provide a unique row identifier, and other conditions.
public final byte getByte(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as a byte. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.BYTE
.
getByte(java.lang.String)
public final byte getByte(String columnName)Returns the value in the
Column
named columnName
as a byte. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not Variant.BYTE
.
This method is typically preferred over getByte(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns, columns that are automatically added to a query to provide a unique row identifier, and other conditions.
public final byte[] getByteArray(int ordinal)This method is used internally by other
com.borland
classes. You should never use this method directly.
public final byte[] getByteArray(String columnName)This method is used internally by other
com.borland
classes. You should never use this method directly.
public final Column getColumn(int ordinal)Returns the
Column
component at the specified ordinal index location.
public final Column getColumn(String columnName)Returns the
Column
component for the specified columnName
.
Similar to hasColumn(java.lang.String)
, however this method throws a DataSetException
if the Column
is not found.
public final String[] getColumnNames(int columnCount)Returns an array containing the names of the first
columnCount
Columns.
On error, this method throws a DataSetException
.
public final java.sql.Date getDate(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as a Date
. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.DATE
.
getDate(java.lang.String)
public final java.sql.Date getDate(String columnName)Returns the value in the
Column
named columnName
as a Date
. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not Variant.DATE
.
This method is typically preferred over getDate(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns (columns that are automatically added to a query to provide a unique row identifier) and other conditions.
public final double getDouble(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as a double. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.DOUBLE
.
getDouble(java.lang.String)
public final double getDouble(String columnName)Returns the value in the
Column
named columnName
as a double. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not Variant.DOUBLE
.
This method is typically preferred over getDouble(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns, columns that are automatically added to a query to provide a unique row identifier, and other conditions.
public final float getFloat(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as a float. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.FLOAT
.
getFloat(java.lang.String)
public final float getFloat(String columnName)Returns the value in the
Column
named columnName
as a float. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not Variant.FLOAT
.
This method is typically preferred over getFloat(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns, columns that are automatically added to a query to provide a unique row identifier, and other conditions.
public final InputStream getInputStream(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as an InputStream
. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.INPUTSTREAM
getInputStream(java.lang.String)
public final InputStream getInputStream(String columnName)Returns the value in the
Column
named columnName
as an InputStream
. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not Variant.INPUTSTREAM
.
This method is typically preferred over getInputStream(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns, columns that are automatically added to a query to provide a unique row identifier, and other conditions.
public final int getInt(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as an int. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.INT
.
getInt(java.lang.String)
public final int getInt(String columnName)Returns the value in the
Column
named columnName
as an int. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not an Variant.INT
.
This method is typically preferred over getInt(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns, columns that are automatically added to a query to provide a unique row identifier, and other conditions.
public final long getLong(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as a long. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.LONG
.
getLong(java.lang.String)
public final long getLong(String columnName)Returns the value in the
Column
named columnName
as a long. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not Variant.LONG
.
This method is typically preferred over getLong(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns, columns that are automatically added to a query to provide a unique row identifier, and other conditions.
public final Object getObject(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as an Object
. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.OBJECT
.
getObject(java.lang.String)
public final Object getObject(String columnName)Returns the value in the
Column
named columnName
as an Object
. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not Variant.OBJECT
.
This method is typically preferred over getObject(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns, columns that are automatically added to a query to provide a unique row identifier, and other conditions.
public final short getShort(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as a short. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.SHORT
.
getShort(java.lang.String)
public final short getShort(String columnName)Returns the value in the
Column
named columnName
as a short. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not Variant.SHORT
.
This method is typically preferred over getShort(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns, columns that are automatically added to a query to provide a unique row identifier, and other conditions.
public final String getString(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as a String
. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.STRING
.
getString(java.lang.String)
public final String getString(String columnName)Returns the value in the
Column
named columnName
as a String
. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not Variant.STRING
.
This method is typically preferred over getString(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns, columns that are automatically added to a query to provide a unique row identifier, and other conditions.
public final Time getTime(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as a Time
. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.TIME
.
getTime(java.lang.String)
public final Time getTime(String columnName)Returns the value in the
Column
named columnName
as a Time
. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not Variant.TIME
.
This method is typically preferred over getTime(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns, columns that are automatically added to a query to provide a unique row identifier, and other conditions.
public final Timestamp getTimestamp(int ordinal)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as a Timestamp
. A DataSetException
is thrown if the ordinal position ordinal
does not exist, or if the column's data type is not Variant.TIMESTAMP
.
getTimestamp(java.lang.String)
public final Timestamp getTimestamp(String columnName)Returns the value in the
Column
named columnName
as a Timestamp
. A DataSetException
is thrown if columnName
does not exist, or if the column's data type is not Variant.TIMESTAMP
.
This method is typically preferred over getTimestamp(int)
since it is more reliable. A column's ordinal value may unexpectedly change due to persistent columns, columns that are automatically added to a query to provide a unique row identifier, and other conditions.
public void getVariant(int ordinal, Variant value)Returns the value in the
Column
indicated by its ordinal position in the ReadRow
as a Variant
. The Variant
is returned as the value
parameter passed into this method.
public void getVariant(String columnName, Variant value)Returns the value in the
Column
named columnName
as a Variant
.
The Variant
is returned as the value
parameter passed into this method.
public final void getVariants(Variant[] values)Gets the
Variants
for a whole row. The array you pass to it must have at least as many members as the return value of getColumnCount()
.
public final Column hasColumn(String columnName)Returns the
Column
object as specified by its String name. Similar to the getColumn
method, however this method returns null if the Column
is not found instead of throwing a DataSetException
.
public final boolean isAssignedNull(int ordinal)Determines whether the data value at location
ordinal
is an assigned null value. If it returns true, the value is an assigned null value; otherwise, it is not and returns false.
public final boolean isAssignedNull(String columnName)Determines whether the data value identified by its column name is an assigned null value. If it returns true, the value is an assigned null value; otherwise, it is not and returns false.
public final boolean isCompatibleList(ReadRow row)This method is used internally by other
com.borland
classes. You should never use this method directly.
public boolean isModified(int ordinal)Returns true if the value at the specified
ordinal
has been modified.
public boolean isModified(String columnName)Returns true if the value at the specified
columnName
has been modified.
public final boolean isNull(int ordinal)Returns true if the value at the specified
ordinal
is either an assigned or unassigned null; false otherwise. To determine if the value is an unassigned null, call the isUnassignedNull(int)
method.
public final boolean isNull(String columnName)Returns true if the value at the specified
columnName
is either an assigned or unassigned null; false otherwise.
To determine if the value is an unassigned null, call the isUnassignedNull(String)
method.
public final boolean isUnassignedNull(int ordinal)Returns true if the value at the specified
ordinal
is an unassigned null; false otherwise.
public final boolean isUnassignedNull(String columnName)Returns true if the value at the specified
columnName
is an unassigned null; false otherwise.
public String toString()Returns a
String
representation of this ReadRow
object. Used by the JBuilder design tools.