com.sas.storage.olap
Interface AxisInterface

All Known Implementing Classes:
Axis, Axis

public interface AxisInterface

An interface representing an axis on a multidimensional result set.

The axis is the root of metadata information for the multidimensional result set. Each result set contains n axes that define the metadata in more detail. The two main components of an axis are the dimensions and the tuples. The dimensions contained on the axis are said to be projected onto the axis. A tuple is the element that combines members from each dimension that is projected onto the axis. Take the following example.

A user may want to know the annual sales for all products sold in the United States and Canada. One way to model these results is to project the Time, Measures, and Products dimensions onto the columns axis and the Geography dimension onto the rows axis. Not all members in a dimension need to be present on the axis in order for that dimension to be projected onto the axis. Sales is just one member of the Measures dimension. Likewise, we may only wish to look at data for Canada and the United States, while excluding data for Germany. Nevertheless, the Geography dimension is still part of the axis. In this example, the columns axis might contain the following set of tuples {(1999,Sales,Chairs), (1999,Sales,Desks), (2000,Sales,Chairs), (2000,Sales,Desks)}.

It is helpful to note that there is a distinction between result set metadata and the metadata which defines a cube. While the axis is an element of the result set metadata, certain cube metadata elements appear throughout the result set metadata. In this case, the unique dimension names contained on an axis are hooks to the cube's metadata. The unique dimension name can be used in a Filter that is applied to an instance of the MetadataInterface. In some cases where a connection to the metadata does not exist the information about the dimension may or may not exist. Also, it is worth noting that there may be some performance implications in obtaining detailed Dimension metadata in cases where the connection does exist.

See Also:
ResultSetMetadataInterface, TupleInterface

Field Summary
static int CACHE_COUNT
          Represents the beginning index of the tuples in the cache
static int CHAPTERS_AXIS
          Represents the Chapters Axis, which is the fifth axis
static int COLUMNS_AXIS
          Represents the Columns Axis, which is the first axis
static int PAGES_AXIS
          Represents the Pages Axis, which is the third axis
static int ROWS_AXIS
          Represents the Rows Axis, which is the second axis
static int SECTIONS_AXIS
          Represents the Secions Axis, which is the fourth axis
static int SLICERS_AXIS
          Represents the Slicers Axis, which is the filter axis
static int START_CACHE_INDEX
          Represents the beginning index of the tuples in the cache
 
Method Summary
 java.lang.String[] getAxisHeaders()
          Return an array of header labels for the axis.
 int getAxisNumber()
          Returns the axis number (COLUMNS, ROWS, PAGES, etc.)
 java.lang.String[] getDimensionNames()
          Returns the dimension names for the dimensions projected on the axis.
 java.lang.String[] getHierarchyNames()
          Return the heirarchy names belonging to this axis
 int getMaximumTupleDepth()
          Return the base number of elements associated with any tuple on the axis.
 ResultSetMetadataInterface getResultSetMetadata()
          Returns the ResultSetMetadata that contains this axis.
 TupleInterface getTuple(int index)
          Returns the tuple at the given index, associated with the axis
 int getTupleCount()
          Returns the number of tuples associated with the axis
 TupleInterface[] getTuples(int index, int count)
          Returns the tuples associated with the axis
 java.lang.String[] getUniqueLevelNames()
          Retrun an array of unique Level names that are on the axis.
 

Field Detail

COLUMNS_AXIS

static final int COLUMNS_AXIS
Represents the Columns Axis, which is the first axis

See Also:
Constant Field Values

ROWS_AXIS

static final int ROWS_AXIS
Represents the Rows Axis, which is the second axis

See Also:
Constant Field Values

PAGES_AXIS

static final int PAGES_AXIS
Represents the Pages Axis, which is the third axis

See Also:
Constant Field Values

SECTIONS_AXIS

static final int SECTIONS_AXIS
Represents the Secions Axis, which is the fourth axis

See Also:
Constant Field Values

CHAPTERS_AXIS

static final int CHAPTERS_AXIS
Represents the Chapters Axis, which is the fifth axis

See Also:
Constant Field Values

SLICERS_AXIS

static final int SLICERS_AXIS
Represents the Slicers Axis, which is the filter axis

See Also:
Constant Field Values

START_CACHE_INDEX

static final int START_CACHE_INDEX
Represents the beginning index of the tuples in the cache

See Also:
Constant Field Values

CACHE_COUNT

static final int CACHE_COUNT
Represents the beginning index of the tuples in the cache

See Also:
Constant Field Values
Method Detail

getResultSetMetadata

ResultSetMetadataInterface getResultSetMetadata()
                                                throws OLAPException
Returns the ResultSetMetadata that contains this axis.

Throws:
OLAPException - if a database error occurs

getDimensionNames

java.lang.String[] getDimensionNames()
                                     throws OLAPException
Returns the dimension names for the dimensions projected on the axis. To learn more information about the dimension, a Filter can be applied to an instance of the MetadataInterface. That Filter will use a dimension name returned by this method. of the MetadataInterface.

Returns:
An array of dimension names for the dimensions projected on the axis
Throws:
OLAPException - if a database error occurs

getTuples

TupleInterface[] getTuples(int index,
                           int count)
                           throws OLAPException
Returns the tuples associated with the axis

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

getTuple

TupleInterface getTuple(int index)
                        throws OLAPException
Returns the tuple at the given index, associated with the axis

Parameters:
index - A zero-based axis coordinate index (0 to getTupleCount()-1).
Returns:
A tuple associated with the axis
Throws:
OLAPException - if a database error occurs

getTupleCount

int getTupleCount()
                  throws OLAPException
Returns the number of tuples associated with the axis

Returns:
The number of tuples associated with the axis
Throws:
OLAPException - if a database error occurs

getMaximumTupleDepth

int getMaximumTupleDepth()
                         throws OLAPException
Return the base number of elements associated with any tuple on the axis. Every tuple on the axis has certain elements that are projected evenly across the entire axis. Typically this number will be the same as the dimensionCount; however, it's possible that the dimension information could be unavailable. This value will always be represented on the axis. The actual depth of an individual tuple may be greater than or equal to the base tuple depth for the axis. Many consumers of this model may find it useful to know the maximum tuple depth for any tuple on a given axis. The tuple depth for a given tuple may exceed the base depth for the axis in order to provide additional 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 maximum tuple depth is not provided directly by the model. Consumers that wish to take advantage of this additional information and require the maximum tuple depth should see the documentation for OLAPUtil, which provides utility methods to help calculate the appropriate the maximum tuple depth.

Returns:
The base number of elements associated with any tuple on the axis.
Throws:
OLAPException - if a database error occurs

getAxisHeaders

java.lang.String[] getAxisHeaders()
                                  throws OLAPException
Return an array of header labels for the axis. In addition to its tuples each axis contains a set of axis headers, one for each depth of the tuple. Therefore, the number of labels for a given axis will be equal the base tuple depth for that axis. Similar to the base tuple depth there may actually be additional axis headers that need to be represented on the axis. These additional headers are for the purpose of providing additional 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. In this case, an additional axis header, "Years", would be appropriate. Consumers that wish to take advantage of this additional information should refer to the documentation for OLAPUtil, which provides utility methods to help calculate the appropriate axis headers.

Returns:
An array of header labels for the axis.
Throws:
OLAPException - if a database error occurs

getUniqueLevelNames

java.lang.String[] getUniqueLevelNames()
                                       throws OLAPException
Retrun an array of unique Level names that are on the axis. These level names are the unique names of the axis headers.

Returns:
unique names of the levels that belong to the axis
Throws:
OLAPException

getHierarchyNames

java.lang.String[] getHierarchyNames()
                                     throws OLAPException
Return the heirarchy names belonging to this axis

Returns:
hierarchy names that belong to the axis.
Throws:
OLAPException

getAxisNumber

int getAxisNumber()
                  throws OLAPException
Returns the axis number (COLUMNS, ROWS, PAGES, etc.)

Returns:
The number of the axis.
Throws:
OLAPException - if a database error occurs



Copyright © 2009 SAS Institute Inc. All Rights Reserved.