Class AbstractRecordValued<F extends ScalarValued>

    • Constructor Detail

      • AbstractRecordValued

        protected AbstractRecordValued​(F[] fieldValues,
                                       ModificationCountProvider modificationCountProvider)
        Constructs a value using the given elements as the field elements. A type will be generated from the element types using default field names.
        Parameters:
        fieldValues - the elements to use as the fields
        modificationCountProvider - modification count provider. required for notification of underlying changes.
      • AbstractRecordValued

        protected AbstractRecordValued​(RecordTokenType type,
                                       F[] fieldValues,
                                       ModificationCountProvider modificationCountProvider)
        Constructs a value using the given elements as the field elements, using the specified type. The field types will be cross-validated against the elements.
        Parameters:
        type - the record schema to use for the value
        fieldValues - the elements to use as the fields
        modificationCountProvider - modification count provider. required for notification of underlying changes.
        Throws:
        DRException - if the provided field types disagree with the types of the elements
      • AbstractRecordValued

        protected AbstractRecordValued​(RecordTokenType type,
                                       F[] fieldValues,
                                       boolean validateType,
                                       ModificationCountProvider modificationCountProvider)
        Constructs a value using the given elements as the field elements, using the specified type.
        Parameters:
        type - the record schema to use for the value
        fieldValues - the elements to use as the fields
        validateType - indicates whether to cross-validate the type with the element types
        modificationCountProvider - modification count provider. required for notification of underlying changes.
        Throws:
        DRException - if type validation is requested and the provided field types disagree with the types of the elements
    • 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 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
      • getField

        public final F 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 RecordValued
        Parameters:
        index - zero-based index into the field list
        Returns:
        the field's value
      • getField

        public final F getField​(String fieldName)
        Description copied from interface: RecordValued
        Gets the value of the field with the given name.
        Specified by:
        getField in interface RecordValued
        Parameters:
        fieldName - the field name
        Returns:
        the field's value
      • getFields

        public final F[] getFields()
        Description copied from interface: RecordValued
        Gets the values of all fields in the record
        Specified by:
        getFields in interface RecordValued
        Returns:
        an array containing the values of the record's fields
      • getConverter

        protected final TokenConverter getConverter()
        Gets a memoized converter for this object. Any conversion operations should use the returned converter to reduce the overhead of allocating converters each time one is required.
        Returns:
        a converter usable with the value
      • newFieldIterator

        public final 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 final 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