Class RTXRow


  • public class RTXRow
    extends Object
    A row of data with typed values defined by metadata (RTXMetadata). A row can also have an optional key, which is only a label and can be used as reference to other data structures. No uniqueness is provided and keys cannot be used to access rows directly. getFormattedString(int) and getFormattedString(String) methods are deprecated, use {getCanonicalStringValue(int) or similar for canonical values and format yourself.
    • Constructor Detail

      • RTXRow

        public RTXRow​(RTXMetadata newMetadata)
        Create a row with the specified metadata.
        Parameters:
        newMetadata - the metadata.
    • Method Detail

      • set

        public void set​(RTXColumn column,
                        Object columnValue)
                 throws RTXColumnRuntimeException
        Set the column to the value. If the column is from this table, the index will be used (faster), otherwise the column will be looked up by name (slower). If the name can't be found or the columns are of different types, an exception will be thrown.
        Parameters:
        column - the column
        columnValue - the column value
        Throws:
        RTXColumnRuntimeException - if an error occurs.
      • getKey

        public String getKey()
        Get the key.
        Returns:
        the optional key of this row, which is only a label and can be used as reference to other data structures. No uniqueness is provided and keys cannot be used to access rows directly.
      • setKey

        public void setKey​(String newKey)
        Set the key. Sets the optional key of this row, which is only a label and can be used as reference to other data structures. No uniqueness is provided and keys cannot be used to access rows directly.
        Parameters:
        newKey -
      • getBigDecimal

        public BigDecimal getBigDecimal​(int columnIndex)
                                 throws RTXColumnRuntimeException
        Get the value of the specified column as a BigDecimal.
        Parameters:
        columnIndex - the column index (0 based)
        Returns:
        the value as a BigDecimal.
        Throws:
        RTXColumnRuntimeException - if an error occurs.
      • getBigDecimal

        public BigDecimal getBigDecimal​(RTXColumn column)
        Get the value of the specified column as a BigDecimal.
        Parameters:
        column - the column
        Returns:
        the value as a BigDecimal.
        Throws:
        RTXColumnRuntimeException - if an error occurs.
      • getString

        public String getString​(int columnIndex)
                         throws RTXColumnRuntimeException
        Get the value of the specified column as a String.
        Parameters:
        columnIndex - the column index (0 based)
        Returns:
        the value as a String.
        Throws:
        RTXColumnRuntimeException - if an error occurs.
      • getString

        public String getString​(RTXColumn column)
        Get the value of the specified column as a String.
        Parameters:
        column - the column
        Returns:
        the value as a String.
        Throws:
        RTXColumnRuntimeException - if an error occurs.
      • getDate

        public ZonedDateTime getDate​(int columnIndex)
        Get the value of the specified column as a DateTimeZone.
        Parameters:
        columnIndex - the column index (0 based)
        Returns:
        the value as a DateTimeZone.
        Throws:
        RTXColumnRuntimeException - if an error occurs.
      • getDate

        public ZonedDateTime getDate​(String columnName)
        Get the value of the specified column as a DateTimeZone.
        Parameters:
        columnName - the column name (case insensitive)
        Returns:
        the value as a DateTimeZone.
        Throws:
        RTXColumnRuntimeException - if an error occurs.
      • getDate

        public ZonedDateTime getDate​(RTXColumn column)
        Get the value of the specified column as a DateTimeZone.
        Parameters:
        column - the column
        Returns:
        the value as a DateTimeZone.
        Throws:
        RTXColumnRuntimeException - if an error occurs.
      • get

        public <T> T get​(RTXColumn<T> column)
        Get the value of the specified column as an appropriate object.
        Parameters:
        column - the column
        Returns:
        the value as a DateTimeZone.
        Throws:
        RTXColumnRuntimeException - if an error occurs.
      • getObject

        public Object getObject​(int columnIndex)
                         throws RTXColumnRuntimeException
        Get the value of the specified column as an appropriate object.
        Parameters:
        columnIndex - the column index (0 based)
        Returns:
        the value as a DateTimeZone.
        Throws:
        RTXColumnRuntimeException - if an error occurs.
      • getObject

        public Object getObject​(String columnName)
                         throws RTXColumnRuntimeException
        Get the value of the specified column as an appropriate object.
        Parameters:
        columnName - the column name (case insensitive)
        Returns:
        the value as a DateTimeZone.
        Throws:
        RTXColumnRuntimeException - if an error occurs.
      • getObject

        public Object getObject​(RTXColumn column)
        Get the value of the specified column as an appropriate object.
        Parameters:
        column - the column
        Returns:
        the value as a DateTimeZone.
        Throws:
        RTXColumnRuntimeException - if an error occurs.
      • getCanonicalStringValue

        public String getCanonicalStringValue​(int columnIndex)
                                       throws RTXColumnRuntimeException
        Get the value as in canonical form (as it would be written to a file).
        Parameters:
        columnIndex - column index (0 based)
        Returns:
        canonical string form.
        Throws:
        RTXColumnRuntimeException - for an invalid column
      • getCanonicalStringValue

        public String getCanonicalStringValue​(String columnName)
                                       throws RTXColumnRuntimeException
        Get the value as in canonical form (as it would be written to a file).
        Parameters:
        columnName - column name
        Returns:
        canonical string form.
        Throws:
        RTXColumnRuntimeException - for an invalid column
      • getMetadata

        public RTXMetadata getMetadata()
        Get the metadata.
        Returns:
        the metadata for this row.
      • addAllMatching

        public List<RTXColumn> addAllMatching​(RTXRow other)
        Add all matching columns from the other row to this row.
        Parameters:
        other - the other row.
        Returns:
        a list of matching columns.