Class RowValue
- java.lang.Object
- 
- org.firebirdsql.gds.ng.fields.RowValue
 
- 
 public class RowValue extends java.lang.ObjectCollection of values of fields. Usually a row or set of parameters.- Since:
- 3.0
- Author:
- Mark Rotteveel
 
- 
- 
Field SummaryFields Modifier and Type Field Description static RowValueEMPTY_ROW_VALUE
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RowValuedeepCopy()Copies thisRowValueand the values it contains.static RowValuedefaultFor(RowDescriptor rowDescriptor)Convenience method for creating a default, uninitialized, row value for aRowDescriptor.static RowValuedeletedRowMarker(int count)Creates a row value that can serve as a deleted row marker.intgetCount()byte[]getFieldData(int index)Get the data of the field withindex.voidinitializeFields()Initializes uninitialized fields withnull.booleanisDeletedRowMarker()Does this row value serve as a deleted row marker.booleanisInitialized(int index)Is the field withindexinitialized.static RowValueof(byte[]... rowData)Convenience method for populating a row value from byte arrays.static RowValueof(RowDescriptor rowDescriptor, byte[]... rowData)Convenience method for populating a row value from a RowDescriptor and byte arrays.voidreset()Resets the state of this row value to uninitialized.voidsetFieldData(int index, byte[] data)Sets the data of the field withindex.
 
- 
- 
- 
Field Detail- 
EMPTY_ROW_VALUEpublic static final RowValue EMPTY_ROW_VALUE 
 
- 
 - 
Method Detail- 
getCountpublic final int getCount() - Returns:
- The number of fields.
 
 - 
setFieldDatapublic void setFieldData(int index, byte[] data)Sets the data of the field withindex.- Parameters:
- index- Index of the field
- data- byte array with data for field, or- null
- Throws:
- java.lang.IndexOutOfBoundsException- if index is not- 0 <= index > getCount()
 
 - 
getFieldDatapublic final byte[] getFieldData(int index) Get the data of the field withindex.For uninitialized fields, returns null. To distinguish between uninitialized or initialized withnull, useisInitialized(int).- Parameters:
- index- Index of the field
- Returns:
- byte array with data for field, or null
- Throws:
- java.lang.IndexOutOfBoundsException- if index is not- 0 <= index > getCount()
 
 - 
resetpublic void reset() Resets the state of this row value to uninitialized.
 - 
isDeletedRowMarkerpublic boolean isDeletedRowMarker() Does this row value serve as a deleted row marker.This is not general purpose functionality, but exists solely to detect deleted rows in updatable result sets. - Returns:
- trueif this a deleted row marker,- falseotherwise
 
 - 
initializeFieldspublic final void initializeFields() Initializes uninitialized fields withnull.
 - 
isInitializedpublic final boolean isInitialized(int index) Is the field withindexinitialized.- Parameters:
- index- Index of the field
- Returns:
- trueif the field is initialized
- Throws:
- java.lang.IndexOutOfBoundsException- if index is not- 0 <= index > getCount()
 
 - 
defaultForpublic static RowValue defaultFor(RowDescriptor rowDescriptor) Convenience method for creating a default, uninitialized, row value for aRowDescriptor.- Parameters:
- rowDescriptor- The row descriptor
- Returns:
- RowValueobject
 
 - 
ofpublic static RowValue of(RowDescriptor rowDescriptor, byte[]... rowData) Convenience method for populating a row value from a RowDescriptor and byte arrays.Note this method, and the similar RowValueBuilderare mainly intended for use inFBDatabaseMetaData.Compared to of(byte[][]), this method has the advantage that it checks if the number of byte arrays is consistent with the row descriptor.- Parameters:
- rowDescriptor- The row descriptor
- rowData- An array of byte arrays with the field data.
- Returns:
- new RowValueobject
- Throws:
- java.lang.IllegalArgumentException- If the- rowDatabyte array count does not match field count of the row descriptor
- See Also:
- RowValueBuilder
 
 - 
deletedRowMarkerpublic static RowValue deletedRowMarker(int count) Creates a row value that can serve as a deleted row marker.All fields have a value of null, and updates will fail with anUnsupportedOperationException.- Parameters:
- count- The number of columns
- Returns:
- RowValueobject
 
 - 
ofpublic static RowValue of(byte[]... rowData) Convenience method for populating a row value from byte arrays.This method is mainly intended for use with direct manipulation in the low-level gds-ng API. - Parameters:
- rowData- An array of byte arrays with the field data.
- Returns:
- new RowValueobject
- See Also:
- RowValueBuilder,- of(RowDescriptor, byte[][])
 
 - 
deepCopypublic final RowValue deepCopy() Copies thisRowValueand 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. - Returns:
- Copy of this object with cloned field values, for empty rows (count is 0) EMPTY_ROW_VALUE.
 
 
- 
 
-