|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lapetus_ltd.api.db.control.TLptsRowEvent
public class TLptsRowEvent
Class Description : This class contains all the information required for a row event from the TLptsFactoryRowSet.
ILptsFactoryRowSetListener.rowEvent(TLptsRowEvent)
and contains all information
Nested Class Summary | |
---|---|
static class |
TLptsRowEvent.EVENT_TYPE
|
Constructor Summary | |
---|---|
TLptsRowEvent(java.util.List<java.lang.Object> rowObjectList,
java.util.List<java.lang.String> columnNameList,
java.util.List<java.lang.Integer> columnTypeList,
java.util.List<byte[]> byteValueList,
TLptsRowEvent.EVENT_TYPE eventType,
TLptsStatement statement,
java.lang.String primaryStatementId,
java.lang.String rowSetId,
int currentRowNo)
Constructor for RowSet Events. |
Method Summary | |
---|---|
java.util.List<byte[]> |
getByteValueList()
Gets the raw byte data for the current row Objects. |
java.util.List<java.lang.String> |
getColumnNameList()
Gets the column names from the current RowSet. |
java.util.List<java.lang.Integer> |
getColumnTypeList()
Get SQL Types for columns from current RowSet. |
int |
getCurrentRowNo()
Gets the current row number. |
TLptsRowEvent.EVENT_TYPE |
getEventType()
Gets the Type of row Event. |
java.lang.String |
getId()
Gets the RowEvent id. |
java.lang.String |
getPrimaryStatementId()
Gets the id from primary Statement to this statement (the one that feeds data to this one). |
java.util.List<java.lang.Object> |
getRowObjectList()
Gets the Object List from the current Row. |
java.lang.String |
getRowSetId()
Gets the Id from the RowSet that generated this event. |
TLptsStatement |
getStatement()
Gets a reference to the statement we executed to get our RowSet. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TLptsRowEvent(java.util.List<java.lang.Object> rowObjectList, java.util.List<java.lang.String> columnNameList, java.util.List<java.lang.Integer> columnTypeList, java.util.List<byte[]> byteValueList, TLptsRowEvent.EVENT_TYPE eventType, TLptsStatement statement, java.lang.String primaryStatementId, java.lang.String rowSetId, int currentRowNo)
Constructor for RowSet Events. This is used internally in the application by TLptsFactoryRowSet.
Thread Safe : Yes
Spawns its own Thread : No
May Return NULL : N/A
Notes :
rowObjectList
- the object list from the current rowcolumnNameList
- the list of column names for this rowSetcolumnTypeList
- the sql types of the row objectsbyteValueList
- the byte data for the objectseventType
- the type of eventstatement
- the statement we executed to get our rowSetprimaryStatementId
- the id of the Primary statement for dynamic substitutionrowSetId
- is the id of the current rowSetcurrentRowNo
- is the number of the current row (or the number of already processed rows)Method Detail |
---|
public final java.util.List<byte[]> getByteValueList()
Gets the raw byte data for the current row Objects.
Thread Safe : Yes
Spawns its own Thread : No
May Return NULL : Never, an empty list in the worst case.
Notes :
Example : Refer to example for getRowObjectList()
.
public final java.util.List<java.lang.String> getColumnNameList()
Gets the column names from the current RowSet.
Thread Safe : Yes
Spawns its own Thread : No
May Return NULL : Never, an empty list in the worst case.
Notes :
Example : Refer to example for getRowObjectList()
.
public final java.util.List<java.lang.Integer> getColumnTypeList()
Get SQL Types for columns from current RowSet.
Thread Safe : Yes
Spawns its own Thread : No
May Return NULL : Never, an empty list in the worst case.
Notes :
Example : Refer to example for getRowObjectList()
.
public final int getCurrentRowNo()
Gets the current row number.
Thread Safe : Yes
Spawns its own Thread : No
May Return NULL : N/A
Notes : This is also equals to the number of rows that have been processed.
Example : Refer to example for getRowObjectList()
.
public final TLptsRowEvent.EVENT_TYPE getEventType()
Gets the Type of row Event.
Thread Safe : Yes
Spawns its own Thread : No
May Return NULL : N/A
Notes : MOVED_TO_NEXT_PRIMARY_RECORD, MOVED_TO_NEXT_RECORD, EXECUTION_INTERRUPTED, PROCESSING_COMPLETE, ERROR_OCCURRED,
Example : Refer to example for getRowObjectList()
.
public final java.lang.String getId()
Gets the RowEvent id. Each row event has a unique id.
Thread Safe : Yes
Spawns its own Thread : No
May Return NULL : Never
Notes :
Example : Refer to example for getRowObjectList()
.
public final java.lang.String getPrimaryStatementId()
Gets the id from primary Statement to this statement (the one that feeds data to this one).
Thread Safe : Yes
Spawns its own Thread : No
May Return NULL : Yes, if statement is not dynamic this id will be null.
Notes :
Example : Refer to example for getRowObjectList()
.
public final java.util.List<java.lang.Object> getRowObjectList()
Gets the Object List from the current Row.
Thread Safe : Yes
Spawns its own Thread : No
May Return NULL : Never, an empty list in the worst case.
Notes :
Example :
// In this example we have implemented a row set factory listener, that adds row events to a tree with the correct // hierarchy, using the primary statement id. Each line of the tree holds all the data of a row or its columns(commented). ... private class RowSetListener implements ILptsFactoryRowSetListener { private MaprowSetMap = new LinkedHashMap (); // this tree holds the row events private JTree rowSetTree = new JTree(new DefaultMutableTreeNode("Root")); private RowSetListener() { rowSetTree.setCellRenderer(new RowSetRenderer()); } public boolean processNewRowSetRows(TLptsRowSetEvent rowSetEvent) { return true; // we want TLptsFactoryRowSet to process the rows and send them to us as row events } public void rowEvent(TLptsRowEvent rowEvent) { DefaultMutableTreeNode treeNodeToAddTo = (DefaultMutableTreeNode)rowSetTree.getModel().getRoot(); if (rowEvent.getEventType().equals(TLptsRowEvent.EVENT_TYPE.MOVED_TO_NEXT_PRIMARY_RECORD) || rowEvent.getEventType().equals(TLptsRowEvent.EVENT_TYPE.MOVED_TO_NEXT_RECORD)) { if (rowEvent.getStatement().hasPrimaryStatement()) if (rowSetMap.get(rowEvent.getPrimaryStatementId()) != null) treeNodeToAddTo = rowSetMap.get(rowEvent.getPrimaryStatementId()); DefaultMutableTreeNode treeNode = new DefaultMutableTreeNode(rowEvent); treeNodeToAddTo.add(treeNode); if (rowEvent.getEventType().equals(TLptsRowEvent.EVENT_TYPE.MOVED_TO_NEXT_PRIMARY_RECORD)) rowSetMap.put(rowEvent.getStatement().getId(), treeNode); } } private class RowSetRenderer implements TreeCellRenderer { public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { String rowString=""; if (value instanceof String) rowString = (String)value; else if (value instanceof TLptsRowEvent) { rowString += ((TLptsRowEvent)value).getCurrentRowNo(); for (Object obj : ((TLptsRowEvent)value).getRowObjectList()) rowString += obj.toString() + " "; //for (String columnName: ((TLptsRowEvent)value).getColumnNameList()) // rowString += columnName + " "; } return new JLabel(rowString); } } }
public final java.lang.String getRowSetId()
Gets the Id from the RowSet that generated this event.
Thread Safe : Yes
Spawns its own Thread : No
May Return NULL : N/A
Notes :
Example : Refer to example for getRowObjectList()
.
public final TLptsStatement getStatement()
Gets a reference to the statement we executed to get our RowSet.
Thread Safe : Yes
Spawns its own Thread : No
May Return NULL : Yes
Notes :
Example : Refer to example for getRowObjectList()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |