public interface Row extends java.lang.Iterable<Column>
To create a row object, call
Table.createRow
.
A program that creates a row must explicitly call
Row.destroy
to reclaim its resources.
This interface is implemented internally. Applications do not implement this interface.
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear all columns in a row.
|
Row |
copy()
Copy a row
|
void |
destroy()
Destroy a row object.
|
ColumnType |
getColumnType(java.lang.String columnName)
Get the type of the column.
|
TibDateTime |
getDateTime(java.lang.String columnName)
Get the value of a TibDateTime field from a row.
|
double |
getDouble(java.lang.String columnName)
Get the value of a double floating-point field from a row.
|
long |
getExpiration()
Get the expiration time for the row.
|
long |
getLong(java.lang.String columnName)
Get the value of a long field from a row.
|
byte[] |
getOpaque(java.lang.String columnName)
Get the value of an opaque field from a row.
|
java.lang.String |
getString(java.lang.String columnName)
Get the value of a string column from a row.
|
Table |
getTable()
Get the table associated with the row
|
boolean |
isColumnSet(java.lang.String columnName)
Determine whether a column is set in a row.
|
RowIterator |
iterator()
Returns a
RowIterator to iterate over the columns of a row. |
void |
setDateTime(java.lang.String columnName,
TibDateTime dateTime)
Set a TibDateTime field in a row.
|
void |
setDouble(java.lang.String columnName,
double value)
Set a double floating-point field in a row.
|
void |
setLong(java.lang.String columnName,
long value)
Set a long integer field in a row.
|
void |
setOpaque(java.lang.String columnName,
byte[] value)
Set an opaque (byte-array) field in a row.
|
void |
setString(java.lang.String columnName,
java.lang.String value)
Set a string field in a row.
|
void |
setTTL(long value)
Set the time-to-live for this row, overriding the table's default value.
|
ColumnType getColumnType(java.lang.String columnName) throws DataGridException
columnName
- The call gets the type of this columnDataGridException
- in case of failuresboolean isColumnSet(java.lang.String columnName) throws DataGridException
If it is not set, then getting the column value throws a DataGridException.
columnName
- The method checks for a column with this name.true
if the field is set; false
otherwiseDataGridException
- in case of failuresjava.lang.String getString(java.lang.String columnName) throws DataGridException
The string is valid only for the lifetime of the row. The string is part of the row object; the program must neither modify nor free it.
columnName
- The method gets the value of the column with this name.DataGridException
- The column is not defined in the tablebyte[] getOpaque(java.lang.String columnName) throws DataGridException
This method copies the bytes from the row.
columnName
- The method gets the value of the column with this name.DataGridException
- The column is not defined in the table, or
is not set in the row.long getLong(java.lang.String columnName) throws DataGridException
columnName
- The method gets the value of the field with this name.DataGridException
- The field is not defined in the table, or
is not set in the row.double getDouble(java.lang.String columnName) throws DataGridException
columnName
- The method gets the value of the column with this name.DataGridException
- The field is not defined in the table, or
is not set in the row.TibDateTime getDateTime(java.lang.String columnName) throws DataGridException
columnName
- The method gets the value of the field with this name.DataGridException
- The field is not defined in the table, or
is not set in the row.void setDateTime(java.lang.String columnName, TibDateTime dateTime) throws DataGridException
The method copies the value into the row.
columnName
- The method sets the value of the column with this name.dateTime
- The method sets this TibDateTime as the column value. If
null, this method clears the field.DataGridException
- in case of failuresvoid setDouble(java.lang.String columnName, double value) throws DataGridException
columnName
- The method sets the value of the column with this name.value
- The method sets this double as the column value.DataGridException
- in case of failuresvoid setString(java.lang.String columnName, java.lang.String value) throws DataGridException
This method copies the string value into the row.
columnName
- The method sets the value of the column with this name.value
- The method sets this string as the column value. If
null, this method clears the field.DataGridException
- in case of failuresvoid setLong(java.lang.String columnName, long value) throws DataGridException
columnName
- The method sets the value of the column with this name.value
- The method sets this long as the column value.DataGridException
- in case of failuresvoid setOpaque(java.lang.String columnName, byte[] value) throws DataGridException
This method copies the entire byte-array into the column.
columnName
- The method sets the value of the column with this name.value
- The method sets this byte-array as the column value. If
null, this method clears the field.DataGridException
- in case of failuresvoid setTTL(long value) throws DataGridException
An application can set this on a row before storing it in the table to override the table's default TTL value. It is an error to set this column on a row if the row's table does not have expiration enabled.
value
- The number of seconds before the row becomes available for
expiration.DataGridException
- in case of failureslong getExpiration() throws DataGridException
It is an error to call this on a row if the row's table does not have expiration enabled or if the row was not retrieved from a table or iterator.
DataGridException
- in case of failuresvoid clear() throws DataGridException
After clearing all columns, you can re-use the row.
This call is more efficient than creating a new empty row.
DataGridException
- in case of failuresTable getTable() throws DataGridException
DataGridException
- in case of failuresRow copy() throws DataGridException
The row returned can be modified and is owned by the caller even if the row it was copies from was not.
DataGridException
- in case of failuresvoid destroy() throws DataGridException
Do not destroy a row if the program needs data that the
row owns -- for example,
a string (from getString
),
an opaque pointer (from getOpaque
)
Destroying a row frees all resources associated with it.
DataGridException
- in case of failuresRowIterator iterator()
RowIterator
to iterate over the columns of a row.iterator
in interface java.lang.Iterable<Column>
RowIterator
to iterate over the columns of a row.