com.sas.storage.olap
Interface TupleInterface

All Known Implementing Classes:
Tuple, Tuple

public interface TupleInterface

An interface representing a tuple in a multidimensional result set.

The tuple concept is a core element of the result set metadata. It combines members from each dimension that is projected onto the axis. Each axis contains a set of tuples with each one representing a single point on the axis. The tuple coordinate uniquely identifies the position of the tuple on the axis.

{(2000, Chairs)} is an example of a tuple where the Time and Products dimensions are projected onto the axis. While this example displays a set of two labels, "2000" and "Chairs", each element of a tuple contains more information than just the displayable text. This information is found in the tuple elements which are returned from the getTupleElements() method.

See Also:
AxisInterface, ResultSetMetadataInterface, TupleElementInterface

Method Summary
 AxisInterface getAxis()
          Return the axis which contains this tuple.
 TupleElementInterface getElement(int index)
          Get the element at the given index from this tuple.
 TupleElementInterface[] getElements(int index, int count)
          Returns an array of tuple elements.
 int getTupleDepth()
          Return the number of elements associated with this tuple.
 int getTupleIndex()
          Returns the tuple index.
 

Method Detail

getAxis

AxisInterface getAxis()
                      throws OLAPException
Return the axis which contains this tuple.

Returns:
The axis which contains this tuple.
Throws:
OLAPException - if a database error occurs

getTupleIndex

int getTupleIndex()
                  throws OLAPException
Returns the tuple index. Every tuple on a given axis can be uniquely identified by a tuple index. The tuple indexes are zero based.

Returns:
The tuple index
Throws:
OLAPException - if a database error occurs

getTupleDepth

int getTupleDepth()
                  throws OLAPException
Return the number of elements associated with this tuple. This value will be greater than or equal to the base tuple depth for the axis. In some cases multiple labels may be displayed for a given dimension in order to provide context for the user. For example, the Quarters of the Time dimension may be projected onto the axis, and the years may be displayed to help provide more contextual information. The tuple depth is a hint for representing this additional information. Consumers of the model that display tuple depths greater than the base tuple depth for the axis should consider determining the maximum tuple depth and additional axis headers that correspond to additional detail provided with the tuple. See the AxisInterface and OLAPUtil for details.

Returns:
The number of elements associated with this tuple.
Throws:
OLAPException - if a database error occurs

getElements

TupleElementInterface[] getElements(int index,
                                    int count)
                                    throws OLAPException
Returns an array of tuple elements. The length of this array should not be greater than the tuple depth for this tuple. In the event that additional elements are provided for context, the elements associated with the same dimension are ordered from least to most specific. For example, [North America, USA, North Carolina, Cary]. Otherwise, the tuple elements are ordered as they were when the query was initially defined. Consumers of the model that display more tuple elements than the base tuple depth for the axis should consider determining the maximum tuple depth and additional axis headers that correspond to additional detail provided with the tuple. See the AxisInterface and OLAPUtil for details.

Parameters:
index - A zero-based tuple element index (0 to getTupleDepth()-1).
count - The number of tuples to return where -1 mean all remaining tuple elements..
Returns:
An array of tuple elements.
Throws:
OLAPException - if a database error occurs

getElement

TupleElementInterface getElement(int index)
                                 throws OLAPException
Get the element at the given index from this tuple.

Parameters:
index - a zero based tuple element index
Returns:
TupleElementInterface an element at the given index
Throws:
OLAPException



Copyright © 2009 SAS Institute Inc. All Rights Reserved.