Modifier and Type | Method and Description |
---|---|
void |
appendRow()
Appends a new row at the end of the table.
|
void |
appendRows(int numRows)
Appends the specified number of empty rows at the end of the table.
|
void |
clear()
Clears the table by deleting all rows.
|
void |
deleteAllRows()
Deletes all rows of this table.
|
void |
deleteRow()
Deletes the current row.
|
void |
deleteRow(int pos)
Deletes the row at the specified position.
|
void |
ensureBufferCapacity(int minRows)
Checks the size of the internal buffer and allocates new memory,
if necessary, and initializes the rows.
|
void |
firstRow()
Moves the row pointer to the first row.
|
int |
getNumColumns()
Returns the number of columns in this table.
|
int |
getNumRows()
Returns the number of rows.
|
JCoRecordFieldIterator |
getRecordFieldIterator()
Returns a JCoRecordFieldIterator.
|
JCoRecordMetaData |
getRecordMetaData()
Returns the appropriated metadata object, that was used for the
creation of this table.
|
int |
getRow()
Returns the current row number.
|
String |
getString()
Returns a String containing all fields of the current row concatenated to one single String.
|
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 |
setString(String fieldsAsString)
Allows to set all fields for the current row handed over by one single String containing
all field values.
|
void |
trimToRows()
Trims the capacity of this table to be the table's current number
of rows.
|
clone, copyFrom, fromJSON, fromJSON, getAbapObject, getAbapObject, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBinaryStream, getBinaryStream, getByte, getByte, getByteArray, getByteArray, getChar, getChar, getCharacterStream, getCharacterStream, getCharArray, getCharArray, getClassNameOfValue, getDate, getDate, getDouble, getDouble, getField, getField, getFieldCount, getFieldIterator, getFloat, getFloat, getInt, getInt, getLong, getLong, getMetaData, getShort, getShort, getString, getString, getStructure, getStructure, getTable, getTable, getTime, getTime, getValue, getValue, isInitialized, isInitialized, iterator, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, toJSON, toJSON, toXML, toXML, toXML, write, write
JCoRecordMetaData getRecordMetaData()
void ensureBufferCapacity(int minRows)
minRows
- the minimum number of rows to allocate memory forvoid trimToRows()
Note: The reallocation of the internal table buffer increases the temporary memory consumption.
boolean isEmpty()
true
if the table is empty, false
otherwiseboolean isFirstRow()
true
if the row pointer is on the first row, false
otherwiseboolean isLastRow()
true
if the row pointer is on the last row, false
otherwiseint getNumRows()
int getNumColumns()
getFieldCount()
.JCoRecord.getFieldCount()
void clear()
void deleteAllRows()
clear()
.clear()
void firstRow()
void lastRow()
boolean nextRow()
if (table.getNumRows() > 0) { table.firstRow(); do { ... } while (table.nextRow()); }
false
if the row pointer is already positioned on the last row of the table, true
otherwiseboolean previousRow()
if (table.getNumRows() > 0) { table.lastRow(); do { ... } while (table.previousRow()); }
false
if the row pointer is already positioned on the first row of the table, true
otherwiseint getRow()
void setRow(int pos)
int numRows = table.getNumRows(); for (int irow = 0; i < numRows; irow++) { table.setRow(irow); ... }Note: If a negative value is specified, the row pointer is set to position 0, and if the specified value is greater than the number of rows, it is moved to the last row.
pos
- the position to set the row pointer tovoid appendRow()
void appendRows(int numRows)
numRows
- the number of empty rows to appendvoid insertRow(int pos)
pos
- the index of the row, before which the new row
shall be insertedvoid deleteRow()
Note: The row pointer is left untouched unless
it would point to a row that would become invalid due to the
deletion operation. In this case the row pointer will be
repositioned to the row at (getNumRows() - 1)
.
void deleteRow(int pos)
Note: The row pointer is left untouched unless
it would point to a row that would become invalid due to the
deletion operation. In this case the row pointer will be
repositioned to the row at (getNumRows() - 1)
.
Example:
If the row pointer points to row 10, it will still point to
row 10 after the deletion operation, even if a row with
pos < 10 was deleted.
pos
- the index of the row to deleteJCoRecordFieldIterator getRecordFieldIterator()
JCoRecord.iterator()
String getString()
Note: The JCoTable
must be a flat table with only simple char-like fields
such as CHAR, NUM, DATE or TIME. The function mimics a 'c-style memcpy'. If the last field is a TYPE_CHAR
,
this method trims all trailing blanks from the returned string.
In addition to programming convenience it should also improve runtime performance compared to fetching
each single field one-by-one.
ConversionException
- if the values could not be converted to a String or the JCoTable
contains fields other than CHAR, NUM, DATE or TIMEvoid setString(String fieldsAsString)
Note: The JCoTable
must be a flat table with only simple char-like fields,
such as CHAR, NUM, DATE or TIME. The function mimics a 'c-style memcpy'.
In addition to programming convenience, it should also improve runtime performance compared to setting
each single field one-by-one.
The function will set all fields 'up to', meaning you can provide a much shorter String for only setting the
first fields. If the String is bigger than the internal buffer for all fields, the remaining substring will
be ignored. DATE and TIME values inside the String can contain '-' or ':' as formatter.
fieldsAsString
- the string to setConversionException
- if the given String could not be converted to the table's internal representation
or the JCoTable
contains fields other than CHAR, NUM, DATE or TIMECopyright © 2019 SAP. All Rights Reserved.