Package com.jk.core.model.table
Class JKTableRecord
java.lang.Object
com.jk.core.model.table.JKTableRecord
This class represents a table row configuration for use with a table
model.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
This enum represents the status of this record. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method adds a new empty column value.void
addEmptyValues
(Vector<JKTableColumn> tableColumns) This method adds multiple new empty column values.getColumn
(int index) This method gets the column values associated with the provided index.int
getColumnIndex
(String name) This method gets the column index using the provided column name.This method gets the columns values.getColumnValue
(int col) This method gets the column values at the specified index.getColumnValue
(String name) This method gets the column values that belong to the column with the provided name.getColumnValueAsDate
(int colIndex) This method gets the column value as date.getColumnValueAsDate
(String colName) This method gets the column value as date.double
getColumnValueAsDouble
(int col) This method gets the column value as double.getColumnValueAsDouble
(int col, double defaultValue) This method gets the column value as double.double
getColumnValueAsDouble
(String colName) This method gets the column value as double.getColumnValueAsFloat
(int col) This method gets the column value as float.int
getColumnValueAsInteger
(int col) This method gets the column value as integer.int
getColumnValueAsInteger
(String colName) This method gets the column value as integer.getFieldValue
(String name) This method gets the field value.This method gets this record status.boolean
isColumnEnabled
(int col) This method check whether this column is enabled or not.boolean
This method check whether this record is modified or not.void
setColumnEnabled
(int col, boolean enable) This method specify the new value of whether the column should be enabled or not.void
setColumnsValues
(Vector<JKTableColumnValue> values) This method changes the column values to the specified values.void
setColumnValue
(int columnIndex, Object value) This method changes the value at the provided index to the specified value.void
setColumnValue
(String colName, Object value) This method changes the value associated with the column with the provided name to the specified value.void
setFieldValue
(String name, Object value) This method sets the field value in the column associated with the provided name to the specified value.void
setStatus
(JKTableRecord.RecordStatus status) This method changes this record status.toHash()
This method convert this record into aHashtable
.This method convert this record into aVector
of values.
-
Constructor Details
-
JKTableRecord
public JKTableRecord()
-
-
Method Details
-
addEmptyValue
This method adds a new empty column value.- Parameters:
col
- Specifies the column the new value is for.
-
addEmptyValues
This method adds multiple new empty column values.- Parameters:
tableColumns
- Specifies the columns the new values are for.
-
getColumn
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
This method gets the column index using the provided column name.- Parameters:
name
- Specifies the column name.- Returns:
- the column index.
-
getColumnsValues
This method gets the columns values.- Returns:
- the columns values.
-
getColumnValue
This method gets the column values at the specified index.- Parameters:
col
- Specifies the column index.- Returns:
- the column values.
-
getColumnValue
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
This method gets the column value as date.- Parameters:
colIndex
- Specifies the column index.- Returns:
- the column value as date.
-
getColumnValueAsDate
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
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
This method gets the column value as double.- Parameters:
colName
- Specifies the column name.- Returns:
- the column value as double
-
getColumnValueAsFloat
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
This method gets the column value as integer.- Parameters:
colName
- Specifies the column name.- Returns:
- the column value as integer.
-
getFieldValue
This method gets the field value.- Parameters:
name
- Specifies the column name.- Returns:
- the field value.
-
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
This method changes the column values to the specified values.- Parameters:
values
- Specifies the new columns values.
-
setColumnValue
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
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
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
This method changes this record status.- Parameters:
status
- Specifies the new record status.
-
toHash
This method convert this record into aHashtable
.- Returns:
- a
Hashtable
view of this record.
-
toValuesVector
This method convert this record into aVector
of values.- Returns:
- a vector containing the values inside this record.
-