|
SAP NetWeaver 2004S SPS 10 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sap.mw.jco.JCO.MetaData
com.sap.mw.jco.JCO.Record
com.sap.mw.jco.JCO.Table
Class that encapsulates a database table
| Nested Class Summary |
| Nested classes inherited from class com.sap.mw.jco.JCO.Record |
JCO.Record.Type1Record, JCO.Record.XMLReader, JCO.Record.XMLWriter |
| Nested classes inherited from class com.sap.mw.jco.JCO.MetaData |
JCO.MetaData.Type1Data |
| Field Summary | |
protected static byte |
OP_APPEND
|
protected static byte |
OP_CLEAR
|
protected static byte |
OP_DELETE
|
protected static byte |
OP_INSERT
|
protected static byte |
OP_NOOP
|
protected static int |
OP_OPCODE_MASK
|
protected static int |
OP_SHIFT
|
protected static byte |
OP_UPDATE
|
protected static int |
OP_VALUE_MASK
|
| Fields inherited from class com.sap.mw.jco.JCO.Record |
data, delta, modified, num_rows, odata, opcode, PARAMETER, rec_type, REQUEST, RESPONSE, row, row_length, SEGMENT, STRUCTURE, TABLE, type1_record |
| Fields inherited from class com.sap.mw.jco.JCO.MetaData |
blength, boffset, decimals, defaults, description, extended_field_meta_data, flags, hash_of_indices, last_active_timestamp, length, name, num_fields, num_odata, offset, oindex, PRINT_HEADER_ALL, PRINT_HEADER_DECIMALS, PRINT_HEADER_DEFAULT, PRINT_HEADER_INTERNAL_LENGTH, PRINT_HEADER_INTERNAL_OFFSET, PRINT_HEADER_LENGTH, PRINT_HEADER_NAME, PRINT_HEADER_OFFSET, PRINT_HEADER_TYPE, rec_name, tab_length, tab_meta, type, type_handle, type_name, type1_data, unicode_type |
| Fields inherited from interface com.sap.mw.jco.IMetaData |
EXPORT_PARAMETER, IMPORT_PARAMETER, INACTIVE_PARAMETER, NESTED_TYPE1_STRUCTURE, 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 |
protected |
JCO.Table(JCO.Structure value)
Creates an new instance of a table which has the same layout as the structure 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(String name)
Creates an instance of the table |
| Method Summary | |
void |
addInfo(String name,
int type,
int length,
int offset,
int decimals,
String sdefault,
String description,
int flags,
Object tab_meta,
com.sap.mw.jco.IExtendedFieldMetaData extended)
Adds a new field descriptor to the meta data object. |
protected void |
appendDelta(byte opcode,
int opvalue)
Appends an opcode for delta management |
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 |
protected void |
copyContent(JCO.Record rsrc,
JCO.Record rdest)
Deprecated. Only for internal use. This method can be removed or modified without notice. |
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. |
protected void |
copyRaw(JCO.Structure src)
Deprecated. Only for internal use. This method can be removed or modified without notice. |
protected static void |
copyRaw(JCO.Structure src,
JCO.Table dest)
Deprecated. Only for internal use. This method can be removed or modified without notice. |
protected static void |
copyRaw(JCO.Table src,
int srcrow,
JCO.Table dest,
int destrow)
Deprecated. Only for internal use. This method can be removed or modified without notice. |
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. |
void |
ensureBufferCapacity(int required_rows)
Checks the size of the buffer and allocates new memory if necessary and initialize the rows. |
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. |
protected void |
setModified(int row)
Sets the updated flag for the current 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 java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final byte OP_NOOP
protected static final byte OP_APPEND
protected static final byte OP_INSERT
protected static final byte OP_DELETE
protected static final byte OP_UPDATE
protected static final byte OP_CLEAR
protected static final int OP_SHIFT
protected static final int OP_OPCODE_MASK
protected static final int OP_VALUE_MASK
| Constructor Detail |
public JCO.Table(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 tableprotected JCO.Table(JCO.Structure value)
value - the initial value of the table| Method Detail |
protected void copyContent(JCO.Record rsrc,
JCO.Record rdest)
copyContent in class JCO.Recordrsrc - the source record
protected static void copyRaw(JCO.Structure src,
JCO.Table dest)
src - the JCO.Structure whose content will be copied into the
current row of the destination table
protected static void copyRaw(JCO.Table src,
int srcrow,
JCO.Table dest,
int destrow)
src - the JCO.Table whose content will be copied into the
current row of the destination tableprotected void copyRaw(JCO.Structure src)
src - the JCO.Structure whose content will be copied into the current row
public void addInfo(String name,
int type,
int length,
int offset,
int decimals,
String sdefault,
String description,
int flags,
Object tab_meta,
com.sap.mw.jco.IExtendedFieldMetaData extended)
IMetaData tableMD = new JCO.MetaData("table name");
tableMD.addInfo(...);
...
tableMD.addInfo(...);
JCO.Table table = new JCO.Table(tableMD);
It is possible to create more than one table instances from one metadata object.
addInfo in interface IMetaDataaddInfo in class JCO.Recordname - Field name for identifying this data fieldtype - Data field typelength - Data field internal length in bytesoffset - Data field offset in the internal JCO data buffer (with -1 JCo compute the offset automatically)decimals - Data field number of decimals (only necessary for the data types JCO.TYPE_BCD and JCO.TYPE_FLOAT)sdefault - Data Field default valuedescription - Description of data fieldflags - additional attribute of the field. Has to be 0tab_meta - Meta-data if the field is a complex field, i.e. structure or table, null otherwiseextended - extended meta data for this field or null if none available.public void ensureBufferCapacity(int required_rows)
public void trimToRows()
protected void setModified(int row)
setModified in class JCO.Recordrow - the index of the row that has been modified
protected void appendDelta(byte opcode,
int opvalue)
opcode - the opcode for the operationopvalue - the value for this operationpublic int copyFrom(JCO.Record source)
copyFrom in class JCO.Recordsource - the source record from which to copy the data
JCO.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.Recordpublic 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);
....
}
pos - the position to set the row pointer 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
|
SAP NetWeaver 2004S SPS 10 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||