public class RowValue
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static RowValue |
EMPTY_ROW_VALUE |
Modifier and Type | Method and Description |
---|---|
RowValue |
deepCopy()
Copies this
RowValue and the values it contains. |
static RowValue |
defaultFor(RowDescriptor rowDescriptor)
Convenience method for creating a default, uninitialized, row value for a
RowDescriptor . |
static RowValue |
deletedRowMarker(int count)
Creates a row value that can serve as a deleted row marker.
|
int |
getCount() |
byte[] |
getFieldData(int index)
Get the data of the field with
index . |
void |
initializeFields()
Initializes uninitialized fields with
null . |
boolean |
isDeletedRowMarker()
Does this row value serve as a deleted row marker.
|
boolean |
isInitialized(int index)
Is the field with
index initialized. |
static RowValue |
of(byte[]... rowData)
Convenience method for populating a row value from byte arrays.
|
static RowValue |
of(RowDescriptor rowDescriptor,
byte[]... rowData)
Convenience method for populating a row value from a RowDescriptor and byte arrays.
|
void |
reset()
Resets the state of this row value to uninitialized.
|
void |
setFieldData(int index,
byte[] data)
Sets the data of the field with
index . |
public static final RowValue EMPTY_ROW_VALUE
public final int getCount()
public void setFieldData(int index, byte[] data)
index
.index
- Index of the fielddata
- byte array with data for field, or null
java.lang.IndexOutOfBoundsException
- if index is not 0 <= index > getCount()
public final byte[] getFieldData(int index)
index
.
For uninitialized fields, returns null
. To distinguish between uninitialized or initialized with
null
, use isInitialized(int)
.
index
- Index of the fieldnull
java.lang.IndexOutOfBoundsException
- if index is not 0 <= index > getCount()
public void reset()
public boolean isDeletedRowMarker()
This is not general purpose functionality, but exists solely to detect deleted rows in updatable result sets.
true
if this a deleted row marker, false
otherwisepublic final void initializeFields()
null
.public final boolean isInitialized(int index)
index
initialized.index
- Index of the fieldtrue
if the field is initializedjava.lang.IndexOutOfBoundsException
- if index is not 0 <= index > getCount()
public static RowValue defaultFor(RowDescriptor rowDescriptor)
RowDescriptor
.rowDescriptor
- The row descriptorRowValue
objectpublic static RowValue of(RowDescriptor rowDescriptor, byte[]... rowData)
Note this method, and the similar RowValueBuilder
are mainly intended for
use in FBDatabaseMetaData
.
Compared to of(byte[][])
, this method has the advantage that it checks if the number of byte arrays
is consistent with the row descriptor.
rowDescriptor
- The row descriptorrowData
- An array of byte arrays with the field data.RowValue
objectjava.lang.IllegalArgumentException
- If the rowData
byte array count does not match field count of the row descriptorRowValueBuilder
public static RowValue deletedRowMarker(int count)
All fields have a value of null
, and updates will fail with an UnsupportedOperationException
.
count
- The number of columnsRowValue
objectpublic static RowValue of(byte[]... rowData)
This method is mainly intended for use with direct manipulation in the low-level gds-ng API.
rowData
- An array of byte arrays with the field data.RowValue
objectRowValueBuilder
,
of(RowDescriptor, byte[][])
public final RowValue deepCopy()
RowValue
and the values it contains.
As the field values are mutable, it is important to consider whether you need to be able to see modifications to the field data, or if you need fields with the same original data. If the former, pass the original, if the latter use this method to obtain a copy.
EMPTY_ROW_VALUE
.Copyright © 2001-2023 Jaybird (Firebird JDBC) team. All rights reserved.