public final class Recordset extends NestedObject
Constructor and Description |
---|
Recordset()
Creates a new uninitialized recordset.
|
Recordset(List<String> _keys)
Creates a new empty Recordset with given columns.
|
Recordset(String[] _keys)
Creates a new empty Recordset with given columns.
|
Modifier and Type | Method and Description |
---|---|
void |
add(CompositeObject object)
Transforms the argument to a Record
and add it into the recordset.
|
void |
add(List<?> row)
Adds a copy of a record as last row.
|
void |
add(Record record)
Adds a copy of a record as last row.
|
void |
addAll(List<?> newRecords)
Adds records to this Recordset.
|
void |
addAll(Recordset recordset)
Adds records from another Recordset to this Recordset.
|
void |
addColumn(String columnName,
List<?> values)
Appends a column into the recordset.
|
void |
clear()
Removes all Records from this Recordset.
|
Recordset |
clone()
Clones this recordset.
|
int |
columnCount()
Returns the number of columns.
|
Recordset |
deepClone()
Creates a deep clone.
|
void |
elementChangedAt(int rowIndex,
int columnIndex)
Informs the listeners that an element was replaced or has changed.
|
Record |
getAt(int row)
Returns a specified (copy of a) record
contained in this recordset.
|
List<Object> |
getColumn(String columnName)
Returns a column.
|
int |
getColumnIndex(String columnName)
Gets the index of the column with the given column name.
|
Object |
getField(int row,
int column)
Returns a specified field value of this recordset.
|
Object |
getField(int row,
String column)
Returns a specified field value of this recordset.
|
List<String> |
getKeys()
Returns a List with the keys of the column-names.
|
List<Record> |
getRecords()
Returns a List with the Records in this Recordset.
|
int |
indexOf(List<?> record)
Returns the first index of a Record in this Recordset.
|
int |
indexOf(Record record)
Returns the first index of a Record in this Recordset.
|
void |
insertAllAt(int index,
List<?> newRecords)
Inserts records into this Recordset.
|
void |
insertAllAt(int index,
Recordset recordset)
Adds records from another Recordset to this Recordset.
|
void |
insertAt(int index,
CompositeObject record)
Inserts a new record at a given index.
|
void |
insertAt(int index,
List<?> record)
Inserts a copy of the argument list as a new row
at the given index in this recordset.
|
void |
insertAt(int index,
Record record)
Inserts a record at a given index.
|
void |
insertColumn(int index,
String columnName,
List<?> values)
Inserts a column into the recordset.
|
int |
lastIndexOf(List<?> record)
Returns the last index of a Record in this Recordset.
|
int |
lastIndexOf(Record record)
Returns the last index of a Record in this Recordset.
|
void |
putField(int row,
String column,
Object newValue)
Set a specified field value in this recordset.
|
void |
remove(List<Object> record)
Removes a Record, given as a List of values, from this Recordset.
|
void |
remove(Record record)
Removes a Record from this Recordset.
|
void |
removeAt(int index)
Removes a Record from this Recordset.
|
int |
size()
Returns the number of Records in this Recordset.
|
void |
sort(String colName)
Sorts the recordset by a column in ascending order.
|
void |
sortDesc(String colName)
Sorts the recordset by a column in descending order.
|
List<Record> |
toList()
Converts this Recordset into a List of Records
|
List<List<Object>> |
toMatrix()
Converts this Recordset into a List of List
|
Tree |
toTree(String keyField,
String parentKeyField)
Creates a new tree from data of this recordset.
|
Tree |
toTree(String keyField,
String parentKeyField,
String valueField)
Creates a new tree from data of this recordset.
|
Tree |
toTree(String keyField,
String parentKeyField,
String valueField,
String infoField)
Creates a new tree from data of this recordset.
|
Tree |
toTreeConstInfo(String keyField,
String parentKeyField,
String valueField,
String info)
Creates a new tree from data of this recordset.
|
equals, hashCode, toString
public Recordset()
public Recordset(String[] _keys)
_keys
- The column-names for the Recordset.public Record getAt(int row)
row
- The index of the required record.public Object getField(int row, String column) throws IllegalArgumentException, IndexOutOfBoundsException
row
- The row number of the required field.column
- The column name of the required field.IllegalArgumentException
- If column name does not existIndexOutOfBoundsException
- If column or row does not existpublic int getColumnIndex(String columnName)
columnName
- a name of a columnpublic Object getField(int row, int column) throws IndexOutOfBoundsException
row
- The row number of the required field.column
- The column index of the required field.IndexOutOfBoundsException
- If column or row does not existpublic void putField(int row, String column, Object newValue) throws IllegalArgumentException
row
- The row number of the required field.column
- The column name of the required field.newValue
- The new value for the specified field.IllegalArgumentException
public int size()
public int columnCount()
public void add(Record record)
record
- The new record.public void add(List<?> row)
row
- The new row.public void add(CompositeObject object)
object
- An ivy object considered as new record.public void insertAt(int index, Record record)
index
- The index where to insert the new record.record
- The Record to insert.public void insertAt(int index, List<?> record)
index
- The index where to insert the new record.record
- The Record to insert.public void insertAt(int index, CompositeObject record)
index
- The index where to insert the new record.record
- The Record to insert.public void addAll(List<?> newRecords)
newRecords
- A list of records;
this List may contain Records or Lists.public void addAll(Recordset recordset)
recordset
- A recordset whose records are
appended to this recordset;public void insertAllAt(int index, List<?> newRecords)
index
- Where to insert the Records.newRecords
- A list of records;
this List may contain Records or Lists.public void insertAllAt(int index, Recordset recordset)
index
- Where to insert the Records.recordset
- A recordset whose records are
inserted to this recordset;public List<Record> toList()
public List<List<Object>> toMatrix()
public List<String> getKeys()
public List<Record> getRecords()
public List<Object> getColumn(String columnName)
columnName
- The name of a column.public void addColumn(String columnName, List<?> values)
columnName
- The name of the new column.values
- A List with the values of the new columns.public void insertColumn(int index, String columnName, List<?> values)
index
- The index where to insert the column.columnName
- The name of the new column.values
- A List with the values of the new columns.public int indexOf(Record record)
record
- A Record.public int indexOf(List<?> record)
record
- A Record, given as List of values.public int lastIndexOf(Record record)
record
- A Record.public int lastIndexOf(List<?> record)
record
- A Record, given as List of values.public void remove(Record record)
record
- The record to remove.public void remove(List<Object> record)
record
- The record to remove.public void removeAt(int index)
index
- The index of the record to remove.public void clear()
public void sort(String colName)
colName
- The column the Recordset is ordered by.public void sortDesc(String colName)
colName
- The column the Recordset is ordered by.public Tree toTree(String keyField, String parentKeyField)
keyField
- the key fieldparentKeyField
- the parent key fieldpublic Tree toTree(String keyField, String parentKeyField, String valueField)
keyField
- the key fieldparentKeyField
- the parent key fieldvalueField
- the field that contains the value of a tree nodepublic Tree toTree(String keyField, String parentKeyField, String valueField, String infoField)
keyField
- the key fieldparentKeyField
- the parent key fieldvalueField
- the field that contains the value of a tree node. Maybe null.infoField
- the field that contains the info. Maybe null. Either _info or infoField or both must be null.public Tree toTreeConstInfo(String keyField, String parentKeyField, String valueField, String info)
keyField
- the key fieldparentKeyField
- the parent key fieldvalueField
- the field that contains the value of a tree nodeinfo
- the info.public void elementChangedAt(int rowIndex, int columnIndex)
rowIndex
- columnIndex
- public Recordset clone()
clone
in interface IIvyDataObject
clone
in class NestedObject
Object.clone()
public Recordset deepClone()
NestedObject
deepClone
in interface IIvyDataObject
deepClone
in class NestedObject
NestedObject.deepClone()
Copyright © 2024
AXON IVY AG
All Rights Reserved Documentation was generated
on April 28, 2024