public class MutableComposite extends Object implements RecordSettable
MutableComposite
can be viewed as the loosest possible implementation of
RecordSettable
.RecordRegister
Constructor and Description |
---|
MutableComposite(RecordTokenType type,
ScalarSettable[] fields)
Construct a composite with the described schema using
the supplied
ScalarSettable objects. |
MutableComposite(T... fields)
Construct a composite with the described schema using
the supplied
Named and ScalarSettable objects. |
Modifier and Type | Method and Description |
---|---|
ScalarSettable |
getField(int index)
Get the field at the given index within the list of fields.
|
ScalarSettable |
getField(String fieldName)
Gets the settable for the field with the given name.
|
ScalarSettable[] |
getFields()
Gets the settables for all fields in the record
|
RecordTokenType |
getType()
Gets the type of data tokens handled by the implementor.
|
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.
|
public MutableComposite(T... fields)
Named
and ScalarSettable
objects.
The record type will be inferred from the provided fields.fields
- the named ScalarSettable
objects to contain field valuespublic MutableComposite(RecordTokenType type, ScalarSettable[] fields)
ScalarSettable
objects. The field types
in the schema will be cross-validated against the given objects.type
- the record schema to use for the resulting compositefields
- the ScalarSettable
objects to contain field valuesDRException
- if the provided field types disagree
with the types of the field objectspublic RecordTokenType getType()
TokenTyped
getType
in interface RecordSettable
getType
in interface RecordTyped
getType
in interface TokenTyped
public int size()
RecordSettable
size
in interface RecordSettable
public ScalarSettable getField(String fieldName)
RecordSettable
getField
in interface RecordSettable
fieldName
- the field namepublic ScalarSettable getField(int index)
RecordSettable
getField
in interface RecordSettable
index
- zero-based index into the field listpublic ScalarSettable[] getFields()
RecordSettable
getFields
in interface RecordSettable
public 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
Copyright © 2021 Actian Corporation. All rights reserved.