com.sas.storage.olap
Interface ResultSetMetadataInterface

All Known Implementing Classes:
ResultSetMetadata, ResultSetMetadata

public interface ResultSetMetadataInterface

An interface that defines the structure and contents of a ResultSet's metadata. The metadata that is available from the ResultSetMetadataInterface is specific to the ResultSet, and it is not the same as the metadata defining a Cube. Metadata for a Cube is a hierarchical set of entities (Dimensions, Hierarchies, Levels, Members) that define how the underlying data is stored. The result set metadata, however, is intended to define the structure and shape of the results. The topmost level of metadata is represented by the AxisInterface, and this information is directly available from the result set via the getAxes() method. A typical query contains two axes, although queries can contain any number of axes. More detailed metadata information can be acquired through the getTuples and getTupleElements methods. The methods are defined in two places. Both are defined directly on the ResultSetMetadataInterface, and they are also available on the AxisInterface and TupleInterface, respectively. Also, if necessary, there are hooks provided in the result set metadata that can provide Cube metadata for Dimensions (via the axes) and Members (via the TupleElements) that are projected onto the result set's axes.

See Also:
AxisInterface, ResultSetInterface, TupleInterface, TupleElementInterface

Method Summary
 AxisInterface[] getAxes(int index, int count)
          Returns the axes associated with this ResultSet.
 AxisInterface getAxis(int index)
          Returns the axis specified at the given index in the resultset.
 TupleElementInterface[] getElements(int axisNumber, int tupleCoordinate, int index, int count)
          Returns an array of tuple elements.
 ResultSetInterface getResultSet()
          Returns the ResultSet that is defined by this metadata.
 TupleInterface[] getTuples(int axisNumber, int index, int count)
          Returns the tuples associated with a given axis.
 

Method Detail

getResultSet

ResultSetInterface getResultSet()
                                throws OLAPException
Returns the ResultSet that is defined by this metadata.

Returns:
The ResultSet that is defined by this metadata.
Throws:
OLAPException - if a database error occurs

getAxes

AxisInterface[] getAxes(int index,
                        int count)
                        throws OLAPException
Returns the axes associated with this ResultSet. An array of AxisInterfaces describing the axes. These axes are 0 based, beginning with the AxisInterface.COLUMNS_AXISCOLUMNS_AXIS axis, followed by AxisInterface.ROWS_AXISROWS_AXIS, then PAGESAXISAxisInterface.PAGES_AXIS, etc. Each axis is non-null, that is no axis is skipped. It's not possible to have a PAGES_AXIS axis without a COLUMNS_AXIS and ROWS_AXIS axis.

Parameters:
index - A zero-based index
count - The number of axes to return where -1 indicates all remaing axes.
Returns:
Information about the axes.
Throws:
OLAPException - if a database error occurs

getAxis

AxisInterface getAxis(int index)
                      throws OLAPException
Returns the axis specified at the given index in the resultset. The index is zero based beginning at AxisInterface.COLUMNS_AXISCOLUMNS_AXIS axis, followed by AxisInterface.ROWS_AXISROWS_AXIS, then PAGES_AXISAxisInterface.PAGES_AXIS, etc.

Parameters:
axisNumber -
index - zero based index or axis number of the axis
Returns:
AxisInterface the axis at the given index
Throws:
OLAPException

getTuples

TupleInterface[] getTuples(int axisNumber,
                           int index,
                           int count)
                           throws OLAPException
Returns the tuples associated with a given axis. The tuples may also be retrieved hierarchically from their parent Axis.

Parameters:
axisNumber - A zero-based axis number
index - A zero-based axis coordinate index (0 to getTupleCount()-1).
count - The number of tuples to return where -1 indicates all remaining tuples.
Returns:
An array of tuples associated with the axis
Throws:
OLAPException - if a database error occurs

getElements

TupleElementInterface[] getElements(int axisNumber,
                                    int tupleCoordinate,
                                    int index,
                                    int count)
                                    throws OLAPException
Returns an array of tuple elements. The TupleElements may also be retrieved hierarchically from their parent Tuple.

Parameters:
axisNumber - A zero-based axis number
tupleCoordinate - A zero-based coordinate which identifies the tuple along a given axis
index - A zero-based tuple element index (0 to Tuple.getTupleDepth()-1).
count - The number of tuples to return where -1 mean all remaining tuple elements..
Returns:
An array of tuple elements The length of this array should not be greater than the tuple depth for the axis associated with this tuple. The labels associated with the same dimension are ordered from least to most specific. For example, [North America, USA, North Carolina, Cary].
Throws:
OLAPException - if a database error occurs



Copyright © 2009 SAS Institute Inc. All Rights Reserved.