|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sap.mw.jco.JCO.MetaData | +--com.sap.mw.jco.JCO.Record | +--com.sap.mw.jco.JCO.Table
Class that encapsulates a database table
Fields inherited from interface com.sap.mw.jco.IMetaData |
EXPORT_PARAMETER, IMPORT_PARAMETER, INACTIVE_PARAMETER, OPTIONAL_PARAMETER, TYPE_BCD, TYPE_BYTE, TYPE_CHAR, TYPE_DATE, TYPE_EXCEPTION, TYPE_FLOAT, TYPE_INT, TYPE_INT1, TYPE_INT2, TYPE_INVALID, TYPE_ITAB, TYPE_NUM, TYPE_STRING, TYPE_STRUCTURE, TYPE_TABLE, TYPE_TIME, TYPE_XSTRING, UNINITIALIZED, UNINITIALIZED_PARAMETER |
Constructor Summary | |
JCO.Table(IMetaData meta_data)
Creates an instance of the table with a column layout as specified by the IMetaData argument |
|
JCO.Table(JCO.Table value)
Creates an new instance of a table which has the same layout and contents as the table argument |
|
JCO.Table(java.lang.String name)
Creates an instance of the table |
Method Summary | |
void |
appendRow()
Appends a new row at the end of the table and moves the row pointer such that it points to the newly appended row. |
void |
appendRows(int num_rows)
Appends the specified number of empty rows at the end of the table. |
void |
clear()
Clears the table, i.e. deletes all rows |
int |
copyFrom(JCO.Record source)
Appends the matching fields from the source record at the end of this table Data fields are considered to be equivalent if the name and type of two fields match. |
void |
deleteAllRows()
Deletes all rows of table |
void |
deleteRow()
Deletes the current row Note:The row pointer will be left untouched unless it would point to a row that would have become invalid due to the deletion operation. |
void |
deleteRow(int pos)
Deletes the row at the specified position. Note:The row pointer will be left untouched unless it would point to a row that would have become invalid due to deletion. |
void |
firstRow()
Moves the row pointer to the first row. |
int |
getNumColumns()
Returns the number of columns in the table This is just a convenience function and returns the same value as getFieldCount(). |
int |
getNumRows()
Returns the number of rows |
int |
getRow()
Returns the current row number. |
void |
insertRow(int pos)
Inserts a new empty row before the specified position |
boolean |
isEmpty()
Checks whether the table is empty. |
boolean |
isFirstRow()
Retrieves whether the row pointer is on the first row of this table. |
boolean |
isLastRow()
Retrieves whether the row pointer is on the last row of this table. |
void |
lastRow()
Moves the row pointer to the last row. |
boolean |
nextRow()
Moves the row pointer to the next row. |
boolean |
previousRow()
Moves the row pointer to the previous row. |
void |
setRow(int pos)
Sets the row pointer to the specified position. |
void |
trimToRows()
Trims the capacity of this table to be the table's current number of rows. |
Methods inherited from class com.sap.mw.jco.JCO.Record |
addInfo, clone, equals, fields, fromXML, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBinaryStream, getBinaryStream, getByteArray, getByteArray, getChar, getChar, getCharacterStream, getCharacterStream, getClassNameOfValue, getClassNameOfValue, getDate, getDate, getDouble, getDouble, getField, getField, getInt, getInt, getLong, getLong, getShort, getShort, getString, getString, getStructure, getStructure, getTable, getTable, getTime, getTime, getValue, getValue, hashCode, readXML, readXML, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, toString, toXML, toXML, toXML, writeHTML, writeHTML, writeXML, writeXML, writeXML, writeXML |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JCO.Table(java.lang.String name)
name
- the name of the tablepublic JCO.Table(IMetaData meta_data)
meta_data
- the layout of the tablepublic JCO.Table(JCO.Table value)
value
- the initial value of the tableMethod Detail |
public void trimToRows()
public int copyFrom(JCO.Record source)
copyFrom
in class JCO.Record
source
- the source record from which to copy the dataJCO.Exception
- if something went wrongpublic final boolean isEmpty()
public final boolean isFirstRow()
public final boolean isLastRow()
public final int getNumRows()
public final int getNumColumns()
JCO.MetaData.getFieldCount()
public void clear()
clear
in class JCO.Record
public void deleteAllRows()
public final void firstRow()
public final void lastRow()
public final boolean nextRow()
if (table.getNumRows() > 0) { table.firstRow(); do { ... while(table.nextRow()); }
public final boolean previousRow()
if (table.getNumRows() > 0) { table.lastRow() do { ... while(table.previousRow()); }
public final int getRow()
public void setRow(int pos)
int num_rows = table.getNumRows(); for (int irow = 0; i < num_rows; irow++) { table.setRow(irow); .... }
row
- the row to position topublic void appendRow()
public void appendRows(int num_rows)
num_rows
- the number of empty rows to appendpublic void insertRow(int pos)
pos
- the index of the row before to insert the new rowpublic void deleteRow()
public void deleteRow(int pos)
pos
- the index of the row to delete
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |