public method O2GOffersTableResponseReader.getCell

Brief

Gets the value of a cell.

Declaration
Java
Object  getCell (int iRow, int iColumn)

Parameters
iRow

The index of a row. The index must be between 0 and O2GGenericTableResponseReader.size() - 1.

iColumn

The index of a column. The index must be between 0 and O2GTableColumnCollection.size() - 1.

Returns

Returns the cell value that can be of different types. To determine a type, it is necessary to get a column by using the O2GGenericTableResponseReader.getColumns and the O2GTableColumnCollection.get methods. The index passed to the latter method should be the same as the column parameter. The type of value is defined by using the O2GTableColumn.getType method. The IO2GTableColumn::O2GTableColumnType enumerator returned by the above method contains the returned value type. A client application can cast object data to the returned type or can use abstract object.

Column types and cast operations:

Column type

getCell value

O2GTableColumnType.INTEGER

The method returns the 32-bit Integer class.
Cast operation: Integer value = (Integer)reader.getCell(columnIndex);

O2GTableColumnType.DOUBLE

The method returns the Double class.
Cast operation: Double value = (double)reader.getCell(column);

O2GTableColumn.BOOLEAN

The method returns the Boolean class.
Cast operation: Boolean value = (Boolean)reader.getCell(column);

O2GTableColumn.DATE

The method returns the calendar.
Cast operation: Calendar value = (Calendar)reader.getCell(column);

O2GTableColumnType.STRING

The method returns a string data value.
Cast operation: String value = (String)reader.getCell(column);

Details

The method is used to work with an abstract table. The method provides common access to a row value independently of a row type (a table type).

Print Generic Table [hide]

private void printGenericTableInterface(O2GGenericTableResponseReader genericReader) {
    System.out.println("Generic table");
    O2GTableColumnCollection columns = genericReader.getColumns();
 
    for (int i = 0; i < genericReader.size(); i++) {
        int iCount = columns.size();
        for (int j = 0; j < iCount; j++) {
            Object value = row.getCell(i, j);
            O2GTableColumn column = columns.get(j);
            if (column.getType() == O2GTableColumnType.DATE) {
                value = ((Calendar)value).getTime();
            }
        String sColumn = MessageFormat.format("{0} {1} {2}", column.getId(), value, column.getType());
        System.out.println(sColumn);
        }
    }
}

Declared in O2GGenericTableResponseReader

back