com.sap.conn.jco

## Interface JCoTable

- All Superinterfaces:
    Cloneable, Iterable<JCoField>, JCoRecord, Serializable

      public interface JCoTable
      extends JCoRecord

  Interface that describes internal tables used in the parameter lists of function modules. It's a data container, that can have multiple rows of the same fields.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 numRows)` Appends the specified number of empty rows at the end of the table.
    `void` | `clear()` Clears the table, i.e.
    `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` | `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.
    `JCoRecordFieldIterator` | `getRecordFieldIterator()` Returns an iterator over JCoRecordField.
    `JCoRecordMetaData` | `getRecordMetaData()` returns the appropriated meta data object, that was used for creation of this record.
    `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 interface com.sap.conn.jco.JCoRecord

      `clone, copyFrom, 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`

- - ### Method Detail

    - #### getRecordMetaData

          JCoRecordMetaData getRecordMetaData()

      returns the appropriated meta data object, that was used for creation of this record.
      Returns:
        JCoRecordMetaData instance of the appropriated meta data object

    - #### ensureBufferCapacity

          void ensureBufferCapacity(int required_rows)

      Checks the size of the buffer and allocates new memory if necessary and initialize the rows.

    - #### trimToRows

          void trimToRows()

      Trims the capacity of this table to be the table's current number of rows. An application can use this operation to minimize the storage requirements of this table. side-effect: the reallocation of the internal table buffers increases the temporary memory consumption.

    - #### isEmpty

          boolean isEmpty()

      Checks whether the table is empty.
      Returns:
        `true` if the table is empty, `false` otherwise.

    - #### isFirstRow

          boolean isFirstRow()

      Retrieves whether the row pointer is on the first row of this table.
      Returns:
        `true` if the row pointer is on the first row, `false` otherwise.

    - #### isLastRow

          boolean isLastRow()

      Retrieves whether the row pointer is on the last row of this table.
      Returns:
        `true` if the row pointer is on the last row, `false` otherwise.

    - #### getNumRows

          int getNumRows()

      Returns the number of rows.
      Returns:
        the number of rows

    - #### getNumColumns

          int getNumColumns()

      Returns the number of columns in the table This is just a convenience function and returns the same value as `getFieldCount()`.
      Returns:
        the number of columns in the table
      See Also:
        `JCoRecord.getFieldCount()`

    - #### clear

          void clear()

      Clears the table, i.e. deletes all rows.
      Specified by:
        `clear` in interface `JCoRecord`

    - #### deleteAllRows

          void deleteAllRows()

      Deletes all rows of table.

    - #### firstRow

          void firstRow()

      Moves the row pointer to the first row.

    - #### lastRow

          void lastRow()

      Moves the row pointer to the last row.

    - #### nextRow

          boolean nextRow()

      Moves the row pointer to the next row. Used to loop through table rows, e.g.

            if (table.getNumRows() > 0) {
                table.firstRow();
                do {
                ...
                while(table.nextRow());
            }

      Returns:
        `false` if at the end of record, `true` otherwise

    - #### previousRow

          boolean previousRow()

      Moves the row pointer to the previous row. Used to loop through table rows, e.g.

            if (table.getNumRows() > 0) {
                table.lastRow()
                do {
                ...
                while(table.previousRow());
            }

      Returns:
        `false` if at the beginning of record, `true` otherwise

    - #### getRow

          int getRow()

      Returns the current row number. The first row number is 0, the second is 1, and so on.
      Returns:
        the current row number

    - #### setRow

          void setRow(int pos)

      Sets the row pointer to the specified position. The first row is at position 0, the second is at position 1, and so on. This method is useful for looping through the table rows, e.g.

            int numRows = table.getNumRows();
            for (int irow = 0; i < numRows; irow++) {
                table.setRow(irow);
                ....
            }

      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.
      Parameters:
        `pos` - the position to set the row pointer to

    - #### appendRow

          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.

    - #### appendRows

          void appendRows(int numRows)

      Appends the specified number of empty rows at the end of the table. The row pointer will be positioned at the first newly added row.
      Parameters:
        `numRows` - the number of empty rows to append

    - #### insertRow

          void insertRow(int pos)

      Inserts a new empty row before the specified position.
      Parameters:
        `pos` - the index of the row before to insert the new row

    - #### deleteRow

          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. In this case the row pointer will be repositioned to the row at `(getNumRows() - 1)`.

    - #### deleteRow

          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. 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 delete operation, even if a row with pos < 10 was deleted.
      Parameters:
        `pos` - the index of the row to delete

    - #### getRecordFieldIterator

          JCoRecordFieldIterator getRecordFieldIterator()

      Returns an iterator over JCoRecordField.
      Returns:
        JCoRecordFieldIterator instance
      See Also:
        `JCoRecord.iterator()`

Copyright © 2016 SAP. All Rights Reserved.