public class TdbTupleList
extends java.lang.Object
For an example of how to use the TdbTupleList class, please refer to the sample com.tietoenator.trip.jxp.examples.data.Tuples.
TdbTuple
Constructor and Description |
---|
TdbTupleList(TdbSession session,
TdbComponent cmp,
java.lang.String strFieldList)
Create a new tuple list.
|
Modifier and Type | Method and Description |
---|---|
TdbTuple |
append()
Creates and appends a new tuple.
|
TdbTuple |
get(int tupleIndex)
Get the row (tuple) at the specified index.
|
int |
getColumnCount()
The number of columns (fields) defined for the TdbTupleList object.
|
java.lang.String |
getColumnName(int index)
Returns the (field) name of the specified column.
|
TdbFieldType |
getColumnType(int index)
Returns the (field) type of the specified column.
|
TdbComponent |
getComponent()
Get the component that holds the fields in the tuple list.
|
java.lang.String |
getDefinition()
The semi-colon delimited definition string that was used to create the tuple list.
|
int |
getRowCount()
The number of rows (tuples) defined for the TdbTupleList instance.
|
TdbTuple |
insert(int tupleIndex)
Creates and inserts a new tuple.
|
void |
remove(int tupleIndex)
Removes a tuple.
|
void |
setComponent(TdbComponent cmp)
Set the component that holds the fields in the tuple list.
|
void |
setDefinition(java.lang.String strFieldList)
Modify the tuple list to use a new set of fields in the same component.
|
public TdbTupleList(TdbSession session, TdbComponent cmp, java.lang.String strFieldList) throws TdbException
Valid fields are fields that are represented by one ofthe TdbStructuredField sub classes, i.e. fields of all types except TEXT and STRING fields.
The fields specified in the field list parameter (strFieldList) must exist in the specified TdbComponent object. If a tuple list is to be used on a new, not yet stored record, remember to use one of the the createField methods to create the appropriate TdbField objects for the component first.
For an example of how to use the TdbTupleList class, please refer to the Programmer's Guide and the Tuples example provided with TRIPjxp.
session
- Active sessioncmp
- The component that contains the fields to use.strFieldList
- Semicolon-delimited string of field names specifying which fields the tuple list should encompass.TdbException
- If the field list could not be created, e.g. when one of the fields does not exist or is not retrieved or created in the component.TdbComponent.createField(TdbFieldDesign)
,
TdbComponent.createField(String, TdbFieldType)
,
TdbStructuredField
public java.lang.String getDefinition()
public void setDefinition(java.lang.String strFieldList) throws TdbException
strFieldList
- Semi-colon delimited list of field names.TdbException
- If reinitialization fails.
If the definition string is different from the pre-existing one, the tuple
list will be reinitialized with the fields in the new definition string. Any
changes made to the values in the formerly tupled fields are kept uncommitted
in the associatd TdbRecord object.TdbRecord
public TdbComponent getComponent()
public void setComponent(TdbComponent cmp) throws TdbException
cmp
- TdbComponent referenceTdbException
- If reinitialization fails.
If the component is different from the pre-existing one, the tuple list
will be reinitialized for the new component. Any changes made to the values
in the tupled fields in the old component are kept uncommitted in the
associated TdbRecord object.TdbRecord
public int getColumnCount()
public int getRowCount()
public java.lang.String getColumnName(int index) throws TdbException
index
- Zero-based index of the column whose name to retrieve.TdbException
- If the index is outside the valid range.public TdbFieldType getColumnType(int index) throws TdbException
index
- Zero-based index of the column whose type to retrieve.TdbException
- If the index is outside the valid range.public TdbTuple get(int tupleIndex) throws TdbException
tupleIndex
- Zero-based index of tuple to retrieve.TdbException
- If the index is outside the valid range.public TdbTuple insert(int tupleIndex) throws TdbException
tupleIndex
- Zero-based index at which to insert a new tuple.TdbException
- If the index is outside the valid range.public TdbTuple append() throws TdbException
TdbException
public void remove(int tupleIndex) throws TdbException
tupleIndex
- Zero-based index of the tuple to be removed.TdbException
- If the index is outside the valid range.