- java.lang.Object
-
- com.pervasive.datarush.tokens.record.MutableComposite
-
- All Implemented Interfaces:
RecordSettable,TokenSettable,RecordTyped,TokenTyped
public class MutableComposite extends Object implements RecordSettable
A composite of settable scalar fields. AMutableCompositecan be viewed as the loosest possible implementation ofRecordSettable.- See Also:
RecordRegister
-
-
Constructor Summary
Constructors Constructor Description MutableComposite(RecordTokenType type, ScalarSettable[] fields)Construct a composite with the described schema using the suppliedScalarSettableobjects.MutableComposite(T... fields)Construct a composite with the described schema using the suppliedNamedandScalarSettableobjects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScalarSettablegetField(int index)Get the field at the given index within the list of fields.ScalarSettablegetField(String fieldName)Gets the settable for the field with the given name.ScalarSettable[]getFields()Gets the settables for all fields in the recordRecordTokenTypegetType()Gets the type of data tokens handled by the implementor.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.intsize()Gets the number of fields in the record schema.
-
-
-
Constructor Detail
-
MutableComposite
public MutableComposite(T... fields)
Construct a composite with the described schema using the suppliedNamedandScalarSettableobjects. The record type will be inferred from the provided fields.- Parameters:
fields- the namedScalarSettableobjects to contain field values
-
MutableComposite
public MutableComposite(RecordTokenType type, ScalarSettable[] fields)
Construct a composite with the described schema using the suppliedScalarSettableobjects. The field types in the schema will be cross-validated against the given objects.- Parameters:
type- the record schema to use for the resulting compositefields- theScalarSettableobjects to contain field values- Throws:
DRException- if the provided field types disagree with the types of the field objects
-
-
Method Detail
-
getType
public RecordTokenType getType()
Description copied from interface:TokenTypedGets the type of data tokens handled by the implementor.- Specified by:
getTypein interfaceRecordSettable- Specified by:
getTypein interfaceRecordTyped- Specified by:
getTypein interfaceTokenTyped- Returns:
- the type of tokens associated with the class.
-
size
public int size()
Description copied from interface:RecordSettableGets the number of fields in the record schema.- Specified by:
sizein interfaceRecordSettable- Returns:
- the number of fields
-
getField
public ScalarSettable getField(String fieldName)
Description copied from interface:RecordSettableGets the settable for the field with the given name.- Specified by:
getFieldin interfaceRecordSettable- Parameters:
fieldName- the field name- Returns:
- the settable field
-
getField
public ScalarSettable getField(int index)
Description copied from interface:RecordSettableGet the field at the given index within the list of fields.- Specified by:
getFieldin interfaceRecordSettable- Parameters:
index- zero-based index into the field list- Returns:
- the settable field
-
getFields
public ScalarSettable[] getFields()
Description copied from interface:RecordSettableGets the settables for all fields in the record- Specified by:
getFieldsin interfaceRecordSettable- Returns:
- an array containing the settable fields
-
set
public void set(TokenValued value)
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
-
-