com.tibbo.aggregate.common.datatable

## Class DataRecord

- java.lang.Object
- - com.tibbo.aggregate.common.datatable.DataRecord

- All Implemented Interfaces:
    PublicCloneable, StringEncodable, java.lang.Cloneable

      public class DataRecord
      extends java.lang.Object
      implements java.lang.Cloneable, PublicCloneable, StringEncodable

  `DataRecord` is a single record of `DataTable`. When created separately from a table, `DataRecord` may have its own `TableFormat` describing record fields and other options.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataRecord()` Constructs a default `DataRecord` with empty `TableFormat`.
    `DataRecord(TableFormat tableFormat)` Constructs a `DataRecord` with specified `TableFormat`.
    `DataRecord(TableFormat tableFormat, java.lang.Object... data)` Constructs a `DataRecord` with specified `TableFormat` and fills it with data field-by-field.
    `DataRecord(TableFormat tableFormat, java.lang.String dataString)`
    `DataRecord(TableFormat tableFormat, java.lang.String dataString, ClassicEncodingSettings settings, boolean validate, java.util.List<java.lang.String> fieldNamesInData)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DataRecord` | `addBoolean(java.lang.Boolean val)` Adds new Boolean to the record.
    `DataRecord` | `addColor(java.awt.Color val)` Adds new Color to the record.
    `DataRecord` | `addData(Data val)` Adds new Data to the record.
    `DataRecord` | `addDataTable(DataTable val)` Adds new DataTable to the record.
    `DataRecord` | `addDate(java.util.Date val)` Adds new Date to the record.
    `DataRecord` | `addDouble(java.lang.Double val)` Adds new Double to the record.
    `DataRecord` | `addFloat(java.lang.Float val)` Adds new Float to the record.
    `DataRecord` | `addInt(java.lang.Integer val)` Adds new Integer to the record.
    `DataRecord` | `addLong(java.lang.Long val)` Adds new Long to the record.
    `DataRecord` | `addString(java.lang.String val)` Adds new String to the record.
    `DataRecord` | `addValue(java.lang.Object value)` Adds new value to the record.
    `DataRecord` | `clone()`
    `void` | `cloneFormatFromTable()`
    `java.lang.String` | `dataAsString(boolean showFieldNames, boolean showHiddenFields)`
    `java.lang.String` | `dataAsString(boolean showFieldNames, boolean showHiddenFields, boolean showPasswords)`
    `java.lang.String` | `encode(boolean useVisibleSeparators)`
    `java.lang.String` | `encode(ClassicEncodingSettings settings)`
    `java.lang.StringBuilder` | `encode(java.lang.StringBuilder sb, ClassicEncodingSettings settings, java.lang.Boolean isTransferEncode, java.lang.Integer encodeLevel)`
    `boolean` | `equals(java.lang.Object obj)`
    `java.lang.Boolean` | `getBoolean(int index)` Returns value of Boolean field with specified index.
    `java.lang.Boolean` | `getBoolean(java.lang.String name)` Returns value of Boolean field with specified name.
    `java.awt.Color` | `getColor(int index)` Returns value of Color field with specified index.
    `java.awt.Color` | `getColor(java.lang.String name)` Returns value of Color field with specified name.
    `Data` | `getData(int index)` Returns value of Data field with specified index.
    `Data` | `getData(java.lang.String name)` Returns value of Data field with specified name.
    `DataTable` | `getDataTable(int index)` Returns value of DataTable field with specified index.
    `DataTable` | `getDataTable(java.lang.String name)` Returns value of DataTable field with specified name.
    `java.util.Date` | `getDate(int index)` Returns value of Date field with specified index.
    `java.util.Date` | `getDate(java.lang.String name)` Returns value of Date field with specified name.
    `java.lang.Double` | `getDouble(int index)` Returns value of Double field with specified index.
    `java.lang.Double` | `getDouble(java.lang.String name)` Returns value of Double field with specified name.
    `int` | `getFieldCount()` Returns number of fields in the record.
    `java.lang.Float` | `getFloat(int index)` Returns value of Float field with specified index.
    `java.lang.Float` | `getFloat(java.lang.String name)` Returns value of Float field with specified name.
    `TableFormat` | `getFormat()` Returns format of the record.
    `FieldFormat` | `getFormat(int index)` Returns format of field with specified index.
    `FieldFormat` | `getFormat(java.lang.String name)` Returns format of the specified field.
    `java.lang.String` | `getId()`
    `java.lang.Integer` | `getInt(int index)` Returns value of Integer field with specified index.
    `java.lang.Integer` | `getInt(java.lang.String name)` Returns value of Integer field with specified name.
    `java.lang.Long` | `getLong(int index)` Returns value of Long field with specified index.
    `java.lang.Long` | `getLong(java.lang.String name)` Returns value of Long field with specified name.
    `java.lang.String` | `getString(int index)` Returns value of String field with specified index.
    `java.lang.String` | `getString(java.lang.String name)` Returns value of String field with specified name.
    `DataTable` | `getTable()`
    `java.lang.Object` | `getValue(int index)` Returns value of field with specified index.
    `java.lang.Object` | `getValue(java.lang.String name)` Returns value of field with specified name.
    `java.lang.String` | `getValueAsString(int index)`
    `java.lang.String` | `getValueAsString(java.lang.String name)`
    `java.lang.Object` | `getValueDescription(java.lang.String name)` Returns textual description of field value.
    `boolean` | `hasField(java.lang.String name)` Returns true if record has field with specified name.
    `int` | `hashCode()`
    `protected boolean` | `meetToCondition(QueryCondition condition)`
    `DataRecord` | `setId(java.lang.String id)`
    `protected void` | `setTable(DataTable table)`
    `DataRecord` | `setValue(int index, java.lang.Object value)` Sets value of field with specified index to `value`.
    `DataRecord` | `setValue(int index, java.lang.Object value, boolean validate)`
    `DataRecord` | `setValue(java.lang.String name, java.lang.Object value)` Sets value of field with specified name to `value`.
    `DataRecord` | `setValue(java.lang.String name, java.lang.Object value, boolean validate)` Sets value of field with specified name to `value`.
    `DataRecord` | `setValueSmart(int index, java.lang.Object value)` Sets value of field with specified index to `value`.
    `DataRecord` | `setValueSmart(java.lang.String name, java.lang.Object value)` Sets value of field with specified name to `value`.
    `java.lang.String` | `toString()`
    `java.lang.String` | `valueAsString(java.lang.String name)`
    `java.lang.String` | `valueAsString(java.lang.String name, boolean showFieldNames, boolean showHiddenFields, boolean showPasswords)`
    `DataTable` | `wrap()` Constructs new `DataTable` and adds this record to it.

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DataRecord

          public DataRecord()

      Constructs a default `DataRecord` with empty `TableFormat`.

    - #### DataRecord

          public DataRecord(TableFormat tableFormat)

      Constructs a `DataRecord` with specified `TableFormat`.

    - #### DataRecord

          public DataRecord(TableFormat tableFormat,
                            java.lang.Object... data)

      Constructs a `DataRecord` with specified `TableFormat` and fills it with data field-by-field.

    - #### DataRecord

          public DataRecord(TableFormat tableFormat,
                            java.lang.String dataString,
                            ClassicEncodingSettings settings,
                            boolean validate,
                            java.util.List<java.lang.String> fieldNamesInData)
                     throws DataTableException

      Throws:
        `DataTableException`

    - #### DataRecord

          public DataRecord(TableFormat tableFormat,
                            java.lang.String dataString)
                     throws DataTableException

      Throws:
        `DataTableException`

  - ### Method Detail

    - #### getFieldCount

          public int getFieldCount()

      Returns number of fields in the record.

    - #### getFormat

          public TableFormat getFormat()

      Returns format of the record.

    - #### getFormat

          public FieldFormat getFormat(int index)

      Returns format of field with specified index.

    - #### getFormat

          public FieldFormat getFormat(java.lang.String name)

      Returns format of the specified field.

    - #### getId

          public java.lang.String getId()

    - #### getTable

          public DataTable getTable()

    - #### encode

          public java.lang.String encode(boolean useVisibleSeparators)

    - #### encode

          public java.lang.String encode(ClassicEncodingSettings settings)

    - #### encode

          public java.lang.StringBuilder encode(java.lang.StringBuilder sb,
                                                ClassicEncodingSettings settings,
                                                java.lang.Boolean isTransferEncode,
                                                java.lang.Integer encodeLevel)

      Specified by:
        `encode` in interface `StringEncodable`

    - #### addInt

          public DataRecord addInt(java.lang.Integer val)

      Adds new Integer to the record.

    - #### addString

          public DataRecord addString(java.lang.String val)

      Adds new String to the record.

    - #### addBoolean

          public DataRecord addBoolean(java.lang.Boolean val)

      Adds new Boolean to the record.

    - #### addLong

          public DataRecord addLong(java.lang.Long val)

      Adds new Long to the record.

    - #### addFloat

          public DataRecord addFloat(java.lang.Float val)

      Adds new Float to the record.

    - #### addDouble

          public DataRecord addDouble(java.lang.Double val)

      Adds new Double to the record.

    - #### addDate

          public DataRecord addDate(java.util.Date val)

      Adds new Date to the record.

    - #### addDataTable

          public DataRecord addDataTable(DataTable val)

      Adds new DataTable to the record.

    - #### addColor

          public DataRecord addColor(java.awt.Color val)

      Adds new Color to the record.

    - #### addData

          public DataRecord addData(Data val)

      Adds new Data to the record.

    - #### setValue

          public DataRecord setValue(int index,
                                     java.lang.Object value)

      Sets value of field with specified index to `value`.

    - #### setValue

          public DataRecord setValue(int index,
                                     java.lang.Object value,
                                     boolean validate)

    - #### setValue

          public DataRecord setValue(java.lang.String name,
                                     java.lang.Object value)

      Sets value of field with specified name to `value`.

    - #### setValue

          public DataRecord setValue(java.lang.String name,
                                     java.lang.Object value,
                                     boolean validate)

      Sets value of field with specified name to `value`.

    - #### setValueSmart

          public DataRecord setValueSmart(int index,
                                          java.lang.Object value)

      Sets value of field with specified index to `value`.

    - #### setValueSmart

          public DataRecord setValueSmart(java.lang.String name,
                                          java.lang.Object value)

      Sets value of field with specified name to `value`.

    - #### addValue

          public DataRecord addValue(java.lang.Object value)

      Adds new value to the record.

    - #### getString

          public java.lang.String getString(java.lang.String name)

      Returns value of String field with specified name.

    - #### getString

          public java.lang.String getString(int index)

      Returns value of String field with specified index.

    - #### getInt

          public java.lang.Integer getInt(java.lang.String name)

      Returns value of Integer field with specified name.

    - #### getInt

          public java.lang.Integer getInt(int index)

      Returns value of Integer field with specified index.

    - #### getBoolean

          public java.lang.Boolean getBoolean(java.lang.String name)

      Returns value of Boolean field with specified name.

    - #### getBoolean

          public java.lang.Boolean getBoolean(int index)

      Returns value of Boolean field with specified index.

    - #### getLong

          public java.lang.Long getLong(java.lang.String name)

      Returns value of Long field with specified name.

    - #### getLong

          public java.lang.Long getLong(int index)

      Returns value of Long field with specified index.

    - #### getFloat

          public java.lang.Float getFloat(java.lang.String name)

      Returns value of Float field with specified name.

    - #### getFloat

          public java.lang.Float getFloat(int index)

      Returns value of Float field with specified index.

    - #### getDouble

          public java.lang.Double getDouble(java.lang.String name)

      Returns value of Double field with specified name.

    - #### getDouble

          public java.lang.Double getDouble(int index)

      Returns value of Double field with specified index.

    - #### getDate

          public java.util.Date getDate(java.lang.String name)

      Returns value of Date field with specified name.

    - #### getDate

          public java.util.Date getDate(int index)

      Returns value of Date field with specified index.

    - #### getDataTable

          public DataTable getDataTable(java.lang.String name)

      Returns value of DataTable field with specified name.

    - #### getDataTable

          public DataTable getDataTable(int index)

      Returns value of DataTable field with specified index.

    - #### getColor

          public java.awt.Color getColor(java.lang.String name)

      Returns value of Color field with specified name.

    - #### getColor

          public java.awt.Color getColor(int index)

      Returns value of Color field with specified index.

    - #### getData

          public Data getData(java.lang.String name)

      Returns value of Data field with specified name.

    - #### getData

          public Data getData(int index)

      Returns value of Data field with specified index.

    - #### getValue

          public java.lang.Object getValue(int index)

      Returns value of field with specified index.

    - #### getValue

          public java.lang.Object getValue(java.lang.String name)

      Returns value of field with specified name.

    - #### getValueDescription

          public java.lang.Object getValueDescription(java.lang.String name)

      Returns textual description of field value. The description is taken from selection values list specified in table format.

    - #### getValueAsString

          public java.lang.String getValueAsString(java.lang.String name)

    - #### getValueAsString

          public java.lang.String getValueAsString(int index)

    - #### setId

          public DataRecord setId(java.lang.String id)

    - #### setTable

          protected void setTable(DataTable table)

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### hasField

          public boolean hasField(java.lang.String name)

      Returns true if record has field with specified name.

    - #### meetToCondition

          protected boolean meetToCondition(QueryCondition condition)

    - #### cloneFormatFromTable

          public void cloneFormatFromTable()

    - #### dataAsString

          public java.lang.String dataAsString(boolean showFieldNames,
                                               boolean showHiddenFields)

    - #### dataAsString

          public java.lang.String dataAsString(boolean showFieldNames,
                                               boolean showHiddenFields,
                                               boolean showPasswords)

    - #### valueAsString

          public java.lang.String valueAsString(java.lang.String name)

    - #### valueAsString

          public java.lang.String valueAsString(java.lang.String name,
                                                boolean showFieldNames,
                                                boolean showHiddenFields,
                                                boolean showPasswords)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### wrap

          public DataTable wrap()

      Constructs new `DataTable` and adds this record to it.

    - #### clone

          public DataRecord clone()

      Specified by:
        `clone` in interface `PublicCloneable`
      Overrides:
        `clone` in class `java.lang.Object`