Class SparseRecordRegister

    • Constructor Detail

      • SparseRecordRegister

        public SparseRecordRegister​(RecordTokenType type)
        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 Detail

      • size

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

        public final boolean isNull()
        Description copied from interface: TokenValued
        Indicates 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:
        isNull in interface TokenValued
        Returns:
        true if the token is null valued, false otherwise
      • containsNull

        public final boolean containsNull()
        Description copied from interface: RecordValued
        Determines if any field in the record is null valued.
        Specified by:
        containsNull in interface RecordValued
        Returns:
        true if at least one field is null valued, false if none are
      • 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
      • getField

        public final ScalarRegister getField​(int index)
        Description copied from interface: RecordValued
        Get the field at the given index within the list of fields.
        Specified by:
        getField in interface RecordSettable
        Specified by:
        getField in interface RecordValued
        Parameters:
        index - zero-based index into the field list
        Returns:
        the field's value
      • newFieldIterator

        public ScalarValuedIterator newFieldIterator​(ScalarTokenType type)
        Description copied from interface: RecordValued
        Create a new iterator for visiting the fields in this RecordValued object. Visitation order will be sorted by the field's index.
        Specified by:
        newFieldIterator in interface RecordValued
        Parameters:
        type - the type of fields over which to iterate
        Returns:
        an iterator over fields of the specified type
      • newFieldIterator

        public ScalarValuedIterator newFieldIterator​(ScalarTokenType type,
                                                     String[] selectedFieldNames)
        Description copied from interface: RecordValued
        Create a new iterator for visiting the fields in this RecordValued object. Visitation order will be sorted by the field's index.
        Specified by:
        newFieldIterator in interface RecordValued
        Parameters:
        type - the type of fields over which to iterate
        selectedFieldNames - the fields over which to iterate
        Returns:
        an iterator over the specified fields