Interface CellSetAxis
-
- All Superinterfaces:
java.lang.Iterable<Position>
public interface CellSetAxis extends java.lang.Iterable<Position>
Axis of a CellSet.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 theiterator()
method to obtain an iterator for sequential access.- Since:
- Aug 22, 2006
- Author:
- jhyde
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CellSetAxisMetaData
getAxisMetaData()
Returns a description of the type (e.g.Axis
getAxisOrdinal()
Returns the axis ordinal of thisCellSetAxis
.CellSet
getCellSet()
Returns theCellSet
which thisCellSetAxis
belongs to.int
getPositionCount()
Returns the number of positions on this CellSetAxis.java.util.List<Position>
getPositions()
Returns a list ofPosition
objects on this CellSetAxis.java.util.ListIterator<Position>
iterator()
Opens an iterator over the positions on this CellSetAxis.
-
-
-
Method Detail
-
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
java.util.List<Position> 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
java.util.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); .... } }
- Specified by:
iterator
in interfacejava.lang.Iterable<Position>
- Returns:
- iterator over the collection of positions
-
-