public interface CellSet extends ResultSet, OlapWrapper
A CellSet
consists of a set of (typically two) axes,
each populated with a sequence of members, and a collection of cells at the
intersection of these axes.
Cell ordinals and coordinates
There are two ways to identify a particular cell: ordinal and coordinates.
Suppose that there are p
axes, and each axis k
(k
between 0 and p - 1
) has
Uk
positions.
There are U
= U0 * ... * Up - 1
cells in total.
Then:
ordinal
is an integer between 0 and
U - 1
.coordinates
are a list of p
integers,
indicating the cell's position on each axis.
Each integer is between 0 and Up-1
.The ordinal number of a cell whose tuple ordinals are
(S0, S1, ... Sp-1)
is
Σi=0p-1 Si . Ei
whereE0 = 1
andEi = Πi=0p-1 Uk
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
Modifier and Type | Method and Description |
---|---|
int |
coordinatesToOrdinal(List<Integer> coordinates)
Converts a list of cell coordinates to a cell ordinal.
|
List<CellSetAxis> |
getAxes()
Retrieves a list of CellSetAxis objects containing the result.
|
Cell |
getCell(int ordinal)
Returns the Cell at an ordinal.
|
Cell |
getCell(List<Integer> coordinates)
Returns the Cell at a given set of coordinates.
|
Cell |
getCell(Position... positions)
Returns the Cell at the intersection of a set of axis positions.
|
CellSetAxis |
getFilterAxis()
Retrieves the CellSetAxis representing the filter axis.
|
CellSetMetaData |
getMetaData()
Retrieves the description of this
CellSet 's axes
and cells. |
OlapStatement |
getStatement()
Retrieves the
OlapStatement object that produced this
CellSet object. |
List<Integer> |
ordinalToCoordinates(int ordinal)
Converts a cell ordinal to a list of cell coordinates.
|
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, close, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
isWrapperFor, unwrap
isWrapperFor, unwrap
OlapStatement getStatement() throws SQLException
OlapStatement
object that produced this
CellSet
object.
If the result set was generated some other way, such as by a
OlapDatabaseMetaData
method, this method may return
null
.getStatement
in interface ResultSet
OlapStatment
object that produced
this CellSet
object or null
if the cell set was produced some other waySQLException
- if a database access error occurs
or this method is called on a closed cell setCellSetMetaData getMetaData() throws OlapException
CellSet
's axes
and cells.getMetaData
in interface ResultSet
CellSet
's axes
and cellsOlapException
- if a database access error occursList<CellSetAxis> getAxes()
The list contains axes according to their ordinal: 0 is the columns axis, 1 the rows axis, and so forth.
getFilterAxis()
CellSetAxis getFilterAxis()
If the query has a WHERE clause, the contains the members returned by that expression. Most query authors write a WHERE clause so that it evaluates to just one member or tuple. The members in this tuple (or the sole member), are referred to as the 'slicer context' of the query. The tuple contains only members of hierarchies explicitly mentioned in the WHERE expression; the slicer context of every hierarchy in the query's cube is implicitly the default member of that hierarchy.
While not typical, note that a query's WHERE clause may also evaluate to zero or more than one tuples.
If the query has no WHERE clause, the filter axis has a single position, but the position has no members.
The filter axis is not included in the getAxes()
collection.
Cell getCell(List<Integer> coordinates)
coordinates
- List of 0-based coordinates of the cellIndexOutOfBoundsException
- if coordinates are outside CellSet
boundsCell getCell(int ordinal)
Equivalent to
getCell(ordinalToCoordinates(ordinal))
ordinal
- 0-based ordinal of the cellIndexOutOfBoundsException
- if ordinal lies outside CellSet boundsCell getCell(Position... positions)
Equivalent to
getCell( Arrays.asList( positions[0].ordinal(), positions[1].ordinal() [, ...]))
positions
- Array of positionsIllegalArgumentException
- if positions does not have the same
number of members as the cell set has axesIndexOutOfBoundsException
- if positions lie outside CellSet
boundsList<Integer> ordinalToCoordinates(int ordinal)
ordinal
- Cell ordinal