Class JKTableRecord

java.lang.Object
com.jk.core.model.table.JKTableRecord

public class JKTableRecord extends Object
This class represents a table row configuration for use with a table model.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Details

    • JKTableRecord

      public JKTableRecord()
  • Method Details

    • addEmptyValue

      public void addEmptyValue(JKTableColumn col)
      This method adds a new empty column value.
      Parameters:
      col - Specifies the column the new value is for.
    • addEmptyValues

      public void addEmptyValues(Vector<JKTableColumn> tableColumns)
      This method adds multiple new empty column values.
      Parameters:
      tableColumns - Specifies the columns the new values are for.
    • getColumn

      public JKTableColumn getColumn(int index)
      This method gets the column values associated with the provided index.
      Parameters:
      index - Specifies the column index.
      Returns:
      the column at the specified index.
    • getColumnIndex

      public int getColumnIndex(String name)
      This method gets the column index using the provided column name.
      Parameters:
      name - Specifies the column name.
      Returns:
      the column index.
    • getColumnsValues

      public Vector<JKTableColumnValue> getColumnsValues()
      This method gets the columns values.
      Returns:
      the columns values.
    • getColumnValue

      public Object getColumnValue(int col)
      This method gets the column values at the specified index.
      Parameters:
      col - Specifies the column index.
      Returns:
      the column values.
    • getColumnValue

      public Object getColumnValue(String name)
      This method gets the column values that belong to the column with the provided name.
      Parameters:
      name - Specifies the column name.
      Returns:
      the column values.
    • getColumnValueAsDate

      public Date getColumnValueAsDate(int colIndex)
      This method gets the column value as date.
      Parameters:
      colIndex - Specifies the column index.
      Returns:
      the column value as date.
    • getColumnValueAsDate

      public Date getColumnValueAsDate(String colName)
      This method gets the column value as date.
      Parameters:
      colName - Specifies the column name.
      Returns:
      the column value as date.
    • getColumnValueAsDouble

      public double getColumnValueAsDouble(int col)
      This method gets the column value as double.
      Parameters:
      col - Specifies the column index.
      Returns:
      the column value as double.
    • getColumnValueAsDouble

      public Double getColumnValueAsDouble(int col, double defaultValue)
      This method gets the column value as double.

      if the value is null, it uses the default value instead.

      Parameters:
      col - Specifies the column index.
      defaultValue - Specifies the default value.
      Returns:
      the column value as double.
    • getColumnValueAsDouble

      public double getColumnValueAsDouble(String colName)
      This method gets the column value as double.
      Parameters:
      colName - Specifies the column name.
      Returns:
      the column value as double
    • getColumnValueAsFloat

      public Float getColumnValueAsFloat(int col)
      This method gets the column value as float.
      Parameters:
      col - Specifies the column index.
      Returns:
      the column value as float.
    • getColumnValueAsInteger

      public int getColumnValueAsInteger(int col)
      This method gets the column value as integer.
      Parameters:
      col - Specifies the column index.
      Returns:
      the column value as integer.
    • getColumnValueAsInteger

      public int getColumnValueAsInteger(String colName)
      This method gets the column value as integer.
      Parameters:
      colName - Specifies the column name.
      Returns:
      the column value as integer.
    • getFieldValue

      public Object getFieldValue(String name)
      This method gets the field value.
      Parameters:
      name - Specifies the column name.
      Returns:
      the field value.
    • getStatus

      public JKTableRecord.RecordStatus getStatus()
      This method gets this record status.
      Returns:
      the record status.
    • isColumnEnabled

      public boolean isColumnEnabled(int col)
      This method check whether this column is enabled or not.
      Parameters:
      col - Specifies the column index.
      Returns:
      true, if the column is enabled, false otherwise.
    • isModified

      public boolean isModified()
      This method check whether this record is modified or not.
      Returns:
      true, if it has been modified, false otherwise.
    • setColumnEnabled

      public void setColumnEnabled(int col, boolean enable)
      This method specify the new value of whether the column should be enabled or not.
      Parameters:
      col - Specifies the column index.
      enable - Indicates whether the column is enabled or not.
    • setColumnsValues

      public void setColumnsValues(Vector<JKTableColumnValue> values)
      This method changes the column values to the specified values.
      Parameters:
      values - Specifies the new columns values.
    • setColumnValue

      public void setColumnValue(int columnIndex, Object value)
      This method changes the value at the provided index to the specified value.
      Parameters:
      columnIndex - Specifies the column index.
      value - Specifies the new value.
    • setColumnValue

      public void setColumnValue(String colName, Object value)
      This method changes the value associated with the column with the provided name to the specified value.
      Parameters:
      colName - Specifies the column name.
      value - Specifies the new value.
    • setFieldValue

      public void setFieldValue(String name, Object value)
      This method sets the field value in the column associated with the provided name to the specified value.
      Parameters:
      name - Specifies the column name.
      value - Specifies the new value.
    • setStatus

      public void setStatus(JKTableRecord.RecordStatus status)
      This method changes this record status.
      Parameters:
      status - Specifies the new record status.
    • toHash

      public Hashtable<String,Object> toHash()
      This method convert this record into a Hashtable.
      Returns:
      a Hashtable view of this record.
    • toValuesVector

      public Vector<Object> toValuesVector()
      This method convert this record into a Vector of values.
      Returns:
      a vector containing the values inside this record.