org.olap4j
public interface CellSetAxis extends Iterable<Position>
A cell set has the same number of axes as the MDX statement which was executed to produce it. For example, a typical cell set, resulting from an MDX query with COLUMNS and ROWS expressions is two-dimensional, and therefore has two axes.
Each axis is an ordered collection of members or tuples. Each member or
tuple on an axis is called a Position
.
The positions on the cell set axis can be accessed sequentially or
random-access. Use the getPositions()
method to return a list for
random access, or the iterator()
method to obtain an iterator for
sequential access.
Modifier and Type | Method and Description |
---|---|
CellSetAxisMetaData |
getAxisMetaData()
Returns a description of the type (e.g.
|
Axis |
getAxisOrdinal()
Returns the axis ordinal of this
CellSetAxis . |
CellSet |
getCellSet()
Returns the
CellSet which this CellSetAxis
belongs to. |
int |
getPositionCount()
Returns the number of positions on this CellSetAxis.
|
List<Position> |
getPositions()
Returns a list of
Position objects on this CellSetAxis. |
ListIterator<Position> |
iterator()
Opens an iterator over the positions on this CellSetAxis.
|
Axis getAxisOrdinal()
CellSetAxis
.
The first axis in a CellSet will return Axis.COLUMNS
,
the second Axis.ROWS
, and so forth, as described by the
Axis.axisOrdinal()
method of the Axis
enumeration.
CellSet getCellSet()
CellSet
which this CellSetAxis
belongs to.CellSetAxisMetaData getAxisMetaData()
Axis.ROWS
) of this
axis, and the hierarchies and properties which will be found on it.
The result is identical to evaluating
getCellSet().getMetaData().getSlicerAxisMetaData()
for a filter axis, and
getCellSet().getMetaData().getAxesMetaData().get(
getAxisOrdinal().axisOrdinal())
for other axes.List<Position> getPositions()
Position
objects on this CellSetAxis.int getPositionCount()
This method can be called at any time. In particular, it is not necessary to complete an iteration through all positions before calling this method.
The number of positions on an axis is important when computing the ordinal of a cell.
ListIterator<Position> iterator()
If this axis has very many positions, this method may be more
efficient than getPositions()
.
This method allows CellSetAxis to implement the Iterable
interface, so one might use it in a foreach construct, for example:
CellSet cellSet; for (Position rowPos : cellSet.getAxes().get(0)) { for (Position colPos : cellSet.getAxes().get(1)) { Cell cell = cellSet.getCell(colPos, rowPos); .... } }