Interface CellSetAxis
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.
- Since:
- Aug 22, 2006
- Author:
- jhyde
-
Method Summary
Modifier and TypeMethodDescriptionReturns a description of the type (e.g.Returns the axis ordinal of thisCellSetAxis
.Returns theCellSet
which thisCellSetAxis
belongs to.int
Returns the number of positions on this CellSetAxis.Returns a list ofPosition
objects on this CellSetAxis.iterator()
Opens an iterator over the positions on this CellSetAxis.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getAxisOrdinal
Axis getAxisOrdinal()Returns the axis ordinal of thisCellSetAxis
.The first axis in a CellSet will return
Axis.COLUMNS
, the secondAxis.ROWS
, and so forth, as described by theAxis.axisOrdinal()
method of theAxis
enumeration.- Returns:
- the ordinal of this axis
-
getCellSet
CellSet getCellSet()Returns theCellSet
which thisCellSetAxis
belongs to.- Returns:
- the CellSet
-
getAxisMetaData
CellSetAxisMetaData getAxisMetaData()Returns a description of the type (e.g.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()
getCellSet().getMetaData().getAxesMetaData().get( getAxisOrdinal().axisOrdinal())
- Returns:
- metadata describing this CellSetAxis
-
getPositions
Returns a list ofPosition
objects on this CellSetAxis.- Returns:
- List of positions on this axis (never null)
-
getPositionCount
int getPositionCount()Returns the number of positions on this CellSetAxis.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.
- Returns:
- the number of positions
-
iterator
ListIterator<Position> iterator()Opens an iterator over the positions on this CellSetAxis.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); .... } }
-