public class SparseRecordRegister extends Object implements DataRegister, RecordValued, RecordSettable
RecordValued
object.
A RecordRegister
can also be thought of as an updateable row of tabular data.Constructor and Description |
---|
SparseRecordRegister(RecordTokenType type)
Constructs a new register with the given record type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsNull()
Determines if any field in the record is null valued.
|
ScalarRegister |
getField(int index)
Get the field at the given index within the list of fields.
|
ScalarRegister |
getField(String fieldName)
Gets the value of the field with the given name.
|
ScalarRegister[] |
getFields()
Gets the values of all fields in the record
|
RecordTokenType |
getType()
Gets the data type of the token.
|
boolean |
isNull()
Indicates whether the token is null valued.
|
ScalarValuedIterator |
newFieldIterator(FieldIteratorProperties properties)
Create a new iterator for visiting the fields in this RecordValued object.
|
ScalarValuedIterator |
newFieldIterator(ScalarTokenType type)
Create a new iterator for visiting the fields in this RecordValued object.
|
ScalarValuedIterator |
newFieldIterator(ScalarTokenType type,
String[] selectedFieldNames)
Create a new iterator for visiting the fields in this RecordValued object.
|
void |
set(TokenValued value)
Sets the contained value to the given token value.
|
void |
setNull()
Sets the contained value to be null valued.
|
void |
setZero()
Sets the contained value to be zero valued.
|
int |
size()
Gets the number of fields in the record schema.
|
String |
toString() |
public SparseRecordRegister(RecordTokenType type)
type
- the record schema of the registerpublic final RecordTokenType getType()
TokenValued
getType
in interface RecordSettable
getType
in interface RecordValued
getType
in interface TokenValued
getType
in interface RecordTyped
getType
in interface TokenTyped
public final int size()
RecordValued
size
in interface RecordSettable
size
in interface RecordValued
public final boolean isNull()
TokenValued
isNull
in interface TokenValued
true
if the token is null valued,
false
otherwisepublic final boolean containsNull()
RecordValued
containsNull
in interface RecordValued
true
if at least one field is null
valued, false
if none arepublic void set(TokenValued value)
TokenSettable
set
in interface TokenSettable
value
- the value to which to set the containerpublic void setNull()
TokenSettable
setNull
in interface TokenSettable
public void setZero()
TokenSettable
setZero
in interface TokenSettable
public final ScalarRegister getField(int index)
RecordValued
getField
in interface RecordSettable
getField
in interface RecordValued
index
- zero-based index into the field listpublic final ScalarRegister getField(String fieldName)
RecordValued
getField
in interface RecordSettable
getField
in interface RecordValued
fieldName
- the field namepublic final ScalarRegister[] getFields()
RecordValued
getFields
in interface RecordSettable
getFields
in interface RecordValued
public ScalarValuedIterator newFieldIterator(ScalarTokenType type)
RecordValued
newFieldIterator
in interface RecordValued
type
- the type of fields over which to iteratepublic ScalarValuedIterator newFieldIterator(ScalarTokenType type, String[] selectedFieldNames)
RecordValued
newFieldIterator
in interface RecordValued
type
- the type of fields over which to iterateselectedFieldNames
- the fields over which to iteratepublic ScalarValuedIterator newFieldIterator(FieldIteratorProperties properties)
RecordValued
FieldIteratorProperties.isSorted()
.newFieldIterator
in interface RecordValued
properties
- properties for the iteratorCopyright © 2024 Actian Corporation. All rights reserved.