public method O2GOffersTableResponseReader.getCell
Brief
Gets the value of a cell.
Declaration | ||||
|
Parameters | |
iRow |
The index of a row. The index must be between |
iColumn |
The index of a column. The index must be between |
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 |
The method returns the 32-bit Integer class. |
|
The method returns the Double class. |
|
The method returns the Boolean class. |
|
The method returns the calendar. |
|
The method returns a string data value. |
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