***  This class is subject to change   ***

com.sas.storage.olap.embedded
Class Axis

java.lang.Object
  |
  +--com.sas.storage.olap.embedded.Axis
All Implemented Interfaces:
AxisInterface

public class Axis
extends java.lang.Object
implements AxisInterface

This implementation is designed for the simple definition of axes in a multidimensional ResultSet. The axes are stored in memory within the model. 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. In this case where a connection to the metadata does not exist the information about the dimension and the member is not available or minimal.

See Also:
AxisInterface, TupleInterface, ResultSetMetadata

Field Summary
 
Fields inherited from interface com.sas.storage.olap.AxisInterface
CACHE_COUNT, CHAPTERS_AXIS, COLUMNS_AXIS, PAGES_AXIS, ROWS_AXIS, SECTIONS_AXIS, SLICERS_AXIS, START_CACHE_INDEX
 
Constructor Summary
Axis(int axisIndex)
          Create an axis based on the index.
Axis(int axisIndex, String[] axisHeaders, TupleInterface[] tuples)
          Create a new Axis
 
Method Summary
 void addTuple(int index, TupleInterface tuple)
          Add a tuple at the specified index.
 void addTuple(TupleInterface tuple)
          Append a tuple.
 TupleInterface[] asTupleArray(List list)
           
 String[] getAxisHeaders()
          Return the axis headers for this axis
 int getAxisNumber()
          Returns the axis number
 String[] getDimensionNames()
          Return the an array of names of all the dimensions projected on the axis.
 String[] getHierarchyNames()
          Return the Hierarchy names set on this axis
 int getMaximumTupleDepth()
          Return the number of labels associated with each tuple.
 ResultSetMetadataInterface getResultSetMetadata()
          Return ResultSetMetaData for this axis
 TupleInterface getTuple(int index)
          Returns the tuple at 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
 String[] getUniqueLevelNames()
          Get the uniqueLevel names
 TupleInterface removeTuple(int index)
          Remove a tuple at the specified index.
 void setAxisHeaders(String[] labels)
          Replace the axis header labels for this axis
 void setDimensionNames(String[] dimensionNames)
          Replace all the dimension names with the dimension names passed in
 void setHierarchyNames(String[] hierarchyNames)
          Set the hierarchy names for this axis
 void setResultSetMetadata(ResultSetMetadataInterface rsm)
          Set the resultset metadata for this axis.
 void setTuple(int index, TupleInterface tuple)
          Replace the tuple at the given index
 void setTuples(int startIndex, int endIndex, TupleInterface[] tuples)
          Replace the tuples associated with the axis
 void setUniqueLevelNames(String[] levelNames)
          Set the unique level names on the axis
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
Constructor Detail

Axis

public Axis(int axisIndex)
     throws OLAPException
Create an axis based on the index. The axis index are zero based beginning with AxisInterface.COLUMNS_AXIS axis, followed by AxisInterface.ROWS_AXIS, then PAGESAXISAxisInterface.PAGES_AXIS, etc. and the last axis is AxisInterface.SLICERS_AXIS
Parameters:
axisIndex - axis index of the axis
Throws:
OLAPException - if the axis cannot be created

Axis

public Axis(int axisIndex,
            String[] axisHeaders,
            TupleInterface[] tuples)
     throws OLAPException
Create a new Axis
Parameters:
axisIndex - axis number for this axis
axisHeaders - headers for the axis that identifies the row/column members on this axis
tuples - that identify the row/column. A null tuple will not be added.
Throws:
OLAPException - if the axis cannot be created
Method Detail

setDimensionNames

public void setDimensionNames(String[] dimensionNames)
                       throws OLAPException
Replace all the dimension names with the dimension names passed in
Parameters:
dimensionNames - dimension names on the axis

setResultSetMetadata

public void setResultSetMetadata(ResultSetMetadataInterface rsm)
                          throws OLAPException
Set the resultset metadata for this axis. This Axis will be added to the resultsetmetadata
Parameters:
rsm - resltsetmetadatafor this axis
Throws:
OLAPException - if the resultsetmetadata cannot be set

getDimensionNames

public String[] getDimensionNames()
                           throws OLAPException
Return the an array of names of all the dimensions projected on the axis. If the dimensions are not set, but the tuples are for the axis, this will return an array of tupleDepth with null dimension names.
Specified by:
getDimensionNames in interface AxisInterface
Returns:
An array of dimension names projected on the axis
Throws:
OLAPException -  

getTuples

public TupleInterface[] getTuples(int index,
                                  int count)
                           throws OLAPException
Returns the tuples associated with the axis
Specified by:
getTuples in interface AxisInterface
Parameters:
index - start index. index should be less than the number of tuples.
count - number of tuples
Returns:
An array of tuples associated with the axis, size of count
Throws:
OLAPException -  

getTuple

public TupleInterface getTuple(int index)
                        throws OLAPException
Returns the tuple at given index associated with the axis
Specified by:
getTuple in interface AxisInterface
Parameters:
index - start index. index should be less than the number of tuples.
Returns:
A tuple associated with the axis
Throws:
OLAPException -  

addTuple

public void addTuple(TupleInterface tuple)
              throws OLAPException
Append a tuple.
Parameters:
tuple - to add
Throws:
OLAPException - if the tuple cannot be added

addTuple

public void addTuple(int index,
                     TupleInterface tuple)
              throws OLAPException
Add a tuple at the specified index. Index is set as a tuple coordinate for the tuple. The minimum and maximum coordinate is adjusted for all the tuples on this axis.
Parameters:
index - insert the tuple at the specified zero based index.
tuple - add a non null tuple
Throws:
OLAPException - if the tuple cannot be added

setTuple

public void setTuple(int index,
                     TupleInterface tuple)
              throws OLAPException
Replace the tuple at the given index
Parameters:
index - replace the tuple at this index. Index should be greater than or equal to zero and less than the current tuple count.
tuple - associated with the axis that is to be replaced
Throws:
OLAPException -  

setTuples

public void setTuples(int startIndex,
                      int endIndex,
                      TupleInterface[] tuples)
               throws OLAPException
Replace the tuples associated with the axis
Parameters:
startIndex - set the tuples beginning at this index. startIndex should be in the range of zero and current tuple count
endIndex - set the tuples upto endIndex, exclusive. endIndex should be greater than startIndex and less than or equal to current tuple count
tuples - An array of tuples associated with the axis
Throws:
OLAPException -  

removeTuple

public TupleInterface removeTuple(int index)
                           throws OLAPException
Remove a tuple at the specified index. If the tuple is not removed from the end then all other tuples move up in the list to fill the gap and the minimum/maximum coordinate is adjusted accordingly
Parameters:
index - remove the tuple at this index. Index should be between 0 and the length of tuple.
Returns:
removed tuple
Throws:
OLAPException - if the tuple cannot be removed

getTupleCount

public int getTupleCount()
Returns the number of tuples associated with the axis
Specified by:
getTupleCount in interface AxisInterface
Returns:
The number of tuples associated with the axis

getMaximumTupleDepth

public int getMaximumTupleDepth()
                         throws OLAPException
Return the number of labels associated with each tuple. This method returns the maximum depth among all tuples.
Specified by:
getMaximumTupleDepth in interface AxisInterface
Returns:
The number of labels associated with each tuple. This value will be greater than or equal to the number of dimensions projected onto 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 information. The tuple depth is a hint for representing this additional information.

getAxisHeaders

public String[] getAxisHeaders()
                        throws OLAPException
Return the axis headers for this axis
Specified by:
getAxisHeaders in interface AxisInterface
Returns:
array of axis header labels. These are the labels of levels from the metadata in connected implementation, in this case it would be whatever is set or null.

setAxisHeaders

public void setAxisHeaders(String[] labels)
                    throws OLAPException
Replace the axis header labels for this axis
Parameters:
labels - Axis header labels for the axis
Throws:
OLAPException -  

getHierarchyNames

public String[] getHierarchyNames()
                           throws OLAPException
Return the Hierarchy names set on this axis
Specified by:
getHierarchyNames in interface AxisInterface
Returns:
an array of hierarchy names set on this axis
Throws:
OLAPException -  
See Also:
AxisInterface.getHierarchyNames()

setHierarchyNames

public void setHierarchyNames(String[] hierarchyNames)
                       throws OLAPException
Set the hierarchy names for this axis
Parameters:
hierarchyNames - and array of hierarchy names for the axis
Throws:
OLAPException -  

getUniqueLevelNames

public String[] getUniqueLevelNames()
                             throws OLAPException
Get the uniqueLevel names
Specified by:
getUniqueLevelNames in interface AxisInterface
Returns:
unique level names on the axis
See Also:
AxisInterface.getUniqueLevelNames()

setUniqueLevelNames

public void setUniqueLevelNames(String[] levelNames)
                         throws OLAPException
Set the unique level names on the axis
Parameters:
levelNames - an array of level names
Throws:
OLAPException -  

getResultSetMetadata

public ResultSetMetadataInterface getResultSetMetadata()
                                                throws OLAPException
Return ResultSetMetaData for this axis
Specified by:
getResultSetMetadata in interface AxisInterface
Returns:
resultset metadata for this axis
Throws:
OLAPException -  

getAxisNumber

public int getAxisNumber()
                  throws OLAPException
Returns the axis number
Specified by:
getAxisNumber in interface AxisInterface
Returns:
The number of the axis (0 for COLUMN, 1 for ROW, 2 for PAGE... -1 for SLICER)
Throws:
OLAPException -  

asTupleArray

public TupleInterface[] asTupleArray(List list)

***  This class is subject to change   ***




Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Thu, 16 Feb 2006 02:17:59