Class MutableComposite

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. A MutableComposite can be viewed as the loosest possible implementation of RecordSettable.
See Also:
  • Constructor Details

    • MutableComposite

      public MutableComposite(T... fields)
      Construct a composite with the described schema using the supplied Named and ScalarSettable objects. The record type will be inferred from the provided fields.
      Parameters:
      fields - the named ScalarSettable objects to contain field values
    • MutableComposite

      public MutableComposite(RecordTokenType type, ScalarSettable[] fields)
      Construct a composite with the described schema using the supplied ScalarSettable objects. The field types in the schema will be cross-validated against the given objects.
      Parameters:
      type - the record schema to use for the resulting composite
      fields - the ScalarSettable objects to contain field values
      Throws:
      DRException - if the provided field types disagree with the types of the field objects
  • Method Details

    • getType

      public RecordTokenType getType()
      Description copied from interface: TokenTyped
      Gets the type of data tokens handled by the implementor.
      Specified by:
      getType in interface RecordSettable
      Specified by:
      getType in interface RecordTyped
      Specified by:
      getType in interface TokenTyped
      Returns:
      the type of tokens associated with the class.
    • size

      public int size()
      Description copied from interface: RecordSettable
      Gets the number of fields in the record schema.
      Specified by:
      size in interface RecordSettable
      Returns:
      the number of fields
    • getField

      public ScalarSettable getField(String fieldName)
      Description copied from interface: RecordSettable
      Gets the settable for the field with the given name.
      Specified by:
      getField in interface RecordSettable
      Parameters:
      fieldName - the field name
      Returns:
      the settable field
    • getField

      public ScalarSettable getField(int index)
      Description copied from interface: RecordSettable
      Get the field at the given index within the list of fields.
      Specified by:
      getField in interface RecordSettable
      Parameters:
      index - zero-based index into the field list
      Returns:
      the settable field
    • getFields

      public ScalarSettable[] getFields()
      Description copied from interface: RecordSettable
      Gets the settables for all fields in the record
      Specified by:
      getFields in interface RecordSettable
      Returns:
      an array containing the settable fields
    • set

      public void set(TokenValued value)
      Description copied from interface: TokenSettable
      Sets the contained value to the given token value. The given value must have a type compatible with this object.
      Specified by:
      set in interface TokenSettable
      Parameters:
      value - the value to which to set the container
    • setNull

      public void setNull()
      Description copied from interface: TokenSettable
      Sets the contained value to be null valued.
      Specified by:
      setNull in interface TokenSettable
    • setZero

      public void setZero()
      Description copied from interface: TokenSettable
      Sets the contained value to be zero valued.
      Specified by:
      setZero in interface TokenSettable