com.sas.storage.olap
Interface TupleElementInterface

All Known Implementing Classes:
TupleElement, TupleElement

public interface TupleElementInterface

An interface representing a tuple element in a multidimensional result set.

The tuple element is the building block of the metadata for the result set. There are a set of tuple elements associated with each tuple, and each of these tuple elements contains information that is essential for rendering a multidimensional result set. The most basic piece is the label, which can be retrieved with the getLabel() method. There are also properties available that indicate whether the element is drilled down or whether it has the same parent as the corresponding element on the previous tuple. These properties provide hints that may be used when determining how to render the result set or what actions may be appropriate for a particular element. The minimum and maximum coordinates are also provided as hints for rendering the results. The same tuple element may appear on contiguous tuples. These coordinates indicate the minimum and maximum axis coordinates on which this tuple element is present.

This interface also provides a hook into the cube metadata. It is helpful to note that there is a distinction between result set metadata and the metadata which defines a cube. Some of the information in this interface can be used in a Filter which can be applied to an instance of the MetadataInterface. The MemberInterface is an element of the cube metadata, and the Filter can be used to returned instances of the MemberInterface. The documentation for a TupleElementInterface implementation should indicate which basic member information is readily available and which detailed information may be unavailable or inefficient to retrieve.

See Also:
AxisInterface, ResultSetMetadataInterface, TupleInterface, MemberInterface

Method Summary
 int getChildCount()
          Returns the number of children for this member.
 java.lang.String getFormat()
          Get the Format associated with this element if it is a measure
 java.lang.String getLabel()
          Returns the label for the tuple element.
 int getLevelDepth()
          Returns the level depth associated with this tuple element.
 int getMaximumCoordinate()
          Returns the largest axis coordinate spanned by the label.
 int getMinimumCoordinate()
          Returns the smallest axis coordinate spanned by the label.
 java.lang.String getName()
          Returns the name for the tuple element.
 java.util.Map getProperties()
          Returns additional properties that were specified for this element
 int getSpan()
          Returns the number indicating the row/column span for this element.
 int getSpanDepth()
          Return a value indicating the depth at which the element be position in a given span value.
 TupleInterface getTuple()
          Returns the parent tuple for this tuple element.
 int getTupleElementIndex()
          Returns the element index.
 com.sas.storage.olap.TupleElementType getType()
          Get the type of this tuple element, supported types are Measures, totals, subtotals, and unspecified.
 java.lang.String getUniqueLevelName()
          Returns the unique level name associated with this tuple element.
 boolean isContextual()
          Returns whether this tuple element is part of the basic ResultSet, or whether it has been added for the purpose of providing additional context for the user.
 boolean isContinued()
          Returns whether this member's parent is the same as the parent of the immediately preceding member.
 boolean isDrilledDown()
          Returns whether this member is drilled down.
 void setMaximumCoordinate(int maximumCoordinate)
          Sets the largest axis coordinate spanned by the label.
 void setMinimumCoordinate(int minimumCoordinate)
          Sets the smallest axis coordinate spanned by the label.
 void setSpan(int span)
          Sets the number indicating the row/column span for this element.
 void setSpanDepth(int depth)
          Sets the number indicating the depth of the lement in to span for this element.
 

Method Detail

getTuple

TupleInterface getTuple()
                        throws OLAPException
Returns the parent tuple for this tuple element.

Returns:
The parent tuple for this element.
Throws:
OLAPException - if a database error occurs

getTupleElementIndex

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

Returns:
The tuple element index
Throws:
OLAPException

getLabel

java.lang.String getLabel()
                          throws OLAPException
Returns the label for the tuple element.

Returns:
The label for the tuple element. (Convenience method for getMember().getLabel())
Throws:
OLAPException - if a database error occurs

getName

java.lang.String getName()
                         throws OLAPException
Returns the name for the tuple element.

Returns:
The name for the tuple element. (Convenience method for getMember().getUniqueName())
Throws:
OLAPException - if a database error occurs

getUniqueLevelName

java.lang.String getUniqueLevelName()
                                    throws OLAPException
Returns the unique level name associated with this tuple element. Convenience method for getMember().getLevel().getUniqueName().

Returns:
The unique level name associated with this tuple element.
Throws:
OLAPException - if a database error occurs

isDrilledDown

boolean isDrilledDown()
                      throws OLAPException
Returns whether this member is drilled down. That is, at least one child of this member appears on the axis, immediately following the member.

Returns:
Indicates whether this member is drilled down. That is, at least one child of this member appears on the axis, immediately following the member.
Throws:
OLAPException - if a database error occurs

isContinued

boolean isContinued()
                    throws OLAPException
Returns whether this member's parent is the same as the parent of the immediately preceding member.

Returns:
Indicates whether this member's parent is the same as the parent of the immediately preceding member.
Throws:
OLAPException - if a database error occurs

isContextual

boolean isContextual()
                     throws OLAPException
Returns whether this tuple element is part of the basic ResultSet, or whether it has been added for the purpose of providing additional context for the user. Consumers that wish to include this context for the user should see the documentation for AxisInterface and OLAPUtil.

Throws:
OLAPException

getLevelDepth

int getLevelDepth()
                  throws OLAPException
Returns the level depth associated with this tuple element. Convenience method for getMember().getLevel().getDepth().

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

getChildCount

int getChildCount()
                  throws OLAPException
Returns the number of children for this member.

Returns:
The number of children for this member.
Throws:
OLAPException - if a database error occurs

getProperties

java.util.Map getProperties()
                            throws OLAPException
Returns additional properties that were specified for this element

Returns:
A Map containing the additional properties that may have been specified for this tuple element. The property name is the key.
Throws:
OLAPException - if a database error occurs

getMinimumCoordinate

int getMinimumCoordinate()
                         throws OLAPException
Returns the smallest axis coordinate spanned by the label. If this is a leaf label, getMinimumCoordinate() will equal getMaximumCoordinate().

Returns:
A zero-based integer that identifies a point along the axis.
Throws:
OLAPException - if a database error occurs
See Also:
getMaximumCoordinate()

getMaximumCoordinate

int getMaximumCoordinate()
                         throws OLAPException
Returns the largest axis coordinate spanned by the label. If this is a leaf label, getMinimumCoordinate() will equal getMaximumCoordinate().

Returns:
A zero-based integer that identifies a point along the axis.
Throws:
OLAPException - if a database error occurs
See Also:
getMinimumCoordinate()

getSpan

int getSpan()
            throws OLAPException
Returns the number indicating the row/column span for this element. This is a convienience method that helps the viewer in position of this element.

Returns:
span value of this element
Throws:
OLAPException

getSpanDepth

int getSpanDepth()
                 throws OLAPException
Return a value indicating the depth at which the element be position in a given span value. This is a convienience method that helps the viewer in position of this element. This is used in ragged hierarchy case.

Returns:
span depth value for the span, 1 based.
Throws:
OLAPException

getFormat

java.lang.String getFormat()
                           throws OLAPException
Get the Format associated with this element if it is a measure

Returns:
the Format associated with this tuple element
Throws:
OLAPException

setMinimumCoordinate

void setMinimumCoordinate(int minimumCoordinate)
                          throws OLAPException
Sets the smallest axis coordinate spanned by the label.

Parameters:
A - zero-based integer that identifies a point along the axis.
Throws:
OLAPException - if a database error occurs
See Also:
setMaximumCoordinate(int)

setMaximumCoordinate

void setMaximumCoordinate(int maximumCoordinate)
                          throws OLAPException
Sets the largest axis coordinate spanned by the label.

Parameters:
A - zero-based integer that identifies a point along the axis.
Throws:
OLAPException - if a database error occurs
See Also:
setMinimumCoordinate(int)

getType

com.sas.storage.olap.TupleElementType getType()
                                              throws OLAPException
Get the type of this tuple element, supported types are Measures, totals, subtotals, and unspecified.

Returns:
element type of either TupleElementType.TOTAL, TupleElementType.SUBTOTAL, TupleElementType.MEASURE, TupleElementType.UNSPECIFIED
Throws:
OLAPException

setSpan

void setSpan(int span)
             throws OLAPException
Sets the number indicating the row/column span for this element. This is a convienience method that helps the viewer in position of this element.

Parameters:
span - value of this element. A 1 based integer that indicates how many rows/column to span.
Throws:
OLAPException

setSpanDepth

void setSpanDepth(int depth)
                  throws OLAPException
Sets the number indicating the depth of the lement in to span for this element. This is a convienience method that helps the viewer in position of this element. This is mainly used in case of ragged hierarchy

Parameters:
span - depth value of this element. A 1 based integer that indicates how deep into the span to position.
Throws:
OLAPException



Copyright © 2009 SAS Institute Inc. All Rights Reserved.