java.lang.Object
com.pervasive.datarush.tokens.record.MutableComposite
- All Implemented Interfaces:
RecordSettable,TokenSettable,RecordTyped,TokenTyped
A composite of settable scalar fields. A
MutableComposite
can be viewed as the loosest possible implementation of
RecordSettable.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMutableComposite(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
Modifier and TypeMethodDescriptiongetField(int index) Get the field at the given index within the list of fields.Gets the settable for the field with the given name.Gets the settables for all fields in the recordgetType()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 Details
-
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
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 Details
-
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
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
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
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
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
-