java.lang.Object
com.pervasive.datarush.tokens.record.SparseRecordRegister
- All Implemented Interfaces:
DataRegister,RecordSettable,RecordValued,TokenSettable,TokenValued,RecordTyped,TokenTyped
public class SparseRecordRegister
extends Object
implements DataRegister, RecordValued, RecordSettable
A composite register of scalar registers; a mutable
RecordValued object.
A RecordRegister can also be thought of as an updateable row of tabular data.-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new register with the given record type. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanDetermines if any field in the record is null valued.final ScalarRegistergetField(int index) Get the field at the given index within the list of fields.final ScalarRegisterGets the value of the field with the given name.final ScalarRegister[]Gets the values of all fields in the recordfinal RecordTokenTypegetType()Gets the data type of the token.final booleanisNull()Indicates whether the token is null valued.newFieldIterator(FieldIteratorProperties properties) Create a new iterator for visiting the fields in this RecordValued object.Create a new iterator for visiting the fields in this RecordValued object.newFieldIterator(ScalarTokenType type, String[] selectedFieldNames) Create a new iterator for visiting the fields in this RecordValued object.voidset(TokenValued value) Sets the contained value to the given token value.voidsetNull()Sets the contained value to be null valued.voidsetZero()Sets the contained value to be zero valued.final intsize()Gets the number of fields in the record schema.toString()
-
Constructor Details
-
SparseRecordRegister
Constructs a new register with the given record type. The resulting field registers are all null-valued initially.- Parameters:
type- the record schema of the register
-
-
Method Details
-
getType
Description copied from interface:TokenValuedGets the data type of the token. This type will dictate the valid values that can be contained.- Specified by:
getTypein interfaceRecordSettable- Specified by:
getTypein interfaceRecordTyped- Specified by:
getTypein interfaceRecordValued- Specified by:
getTypein interfaceTokenTyped- Specified by:
getTypein interfaceTokenValued- Returns:
- the token type.
-
size
public final int size()Description copied from interface:RecordValuedGets the number of fields in the record schema.- Specified by:
sizein interfaceRecordSettable- Specified by:
sizein interfaceRecordValued- Returns:
- the number of fields
-
isNull
public final boolean isNull()Description copied from interface:TokenValuedIndicates whether the token is null valued. Tokens support null values analogous to SQL. Before accessing the value of the container, it is usually best to ensure it is not null valued using this method.- Specified by:
isNullin interfaceTokenValued- Returns:
trueif the token is null valued,falseotherwise
-
containsNull
public final boolean containsNull()Description copied from interface:RecordValuedDetermines if any field in the record is null valued.- Specified by:
containsNullin interfaceRecordValued- Returns:
trueif at least one field is null valued,falseif none are
-
set
Description copied from interface:TokenSettableSets the contained value to the given token value. The given value must have a type compatible with this object.- Specified by:
setin interfaceTokenSettable- Parameters:
value- the value to which to set the container
-
setNull
public void setNull()Description copied from interface:TokenSettableSets the contained value to be null valued.- Specified by:
setNullin interfaceTokenSettable
-
setZero
public void setZero()Description copied from interface:TokenSettableSets the contained value to be zero valued.- Specified by:
setZeroin interfaceTokenSettable
-
toString
-
getField
Description copied from interface:RecordValuedGet the field at the given index within the list of fields.- Specified by:
getFieldin interfaceRecordSettable- Specified by:
getFieldin interfaceRecordValued- Parameters:
index- zero-based index into the field list- Returns:
- the field's value
-
getField
Description copied from interface:RecordValuedGets the value of the field with the given name.- Specified by:
getFieldin interfaceRecordSettable- Specified by:
getFieldin interfaceRecordValued- Parameters:
fieldName- the field name- Returns:
- the field's value
-
getFields
Description copied from interface:RecordValuedGets the values of all fields in the record- Specified by:
getFieldsin interfaceRecordSettable- Specified by:
getFieldsin interfaceRecordValued- Returns:
- an array containing the values of the record's fields
-
newFieldIterator
Description copied from interface:RecordValuedCreate a new iterator for visiting the fields in this RecordValued object. Visitation order will be sorted by the field's index.- Specified by:
newFieldIteratorin interfaceRecordValued- Parameters:
type- the type of fields over which to iterate- Returns:
- an iterator over fields of the specified type
-
newFieldIterator
Description copied from interface:RecordValuedCreate a new iterator for visiting the fields in this RecordValued object. Visitation order will be sorted by the field's index.- Specified by:
newFieldIteratorin interfaceRecordValued- Parameters:
type- the type of fields over which to iterateselectedFieldNames- the fields over which to iterate- Returns:
- an iterator over the specified fields
-
newFieldIterator
Description copied from interface:RecordValuedCreate a new iterator for visiting the fields in this RecordValued object. Visitation order will optionally be sorted by the field's index, depending on the value ofFieldIteratorProperties.isSorted().- Specified by:
newFieldIteratorin interfaceRecordValued- Parameters:
properties- properties for the iterator- Returns:
- an iterator over the fields
-