com.sas.mdtable
Class AbstractDimension

java.lang.Object
  |
  +--com.sas.mdtable.AbstractNode
        |
        +--com.sas.mdtable.AbstractDimension
All Implemented Interfaces:
DimensionInterface, NodeInterface, NodeInterface, SimpleNodeInterface

public abstract class AbstractDimension
extends AbstractNode
implements DimensionInterface

Defines an abstract base class for an implementation of DimensionInterface.

See Also:
AbstractAxis, AbstractHierarchy, AbstractLevel, AbstractMember

Field Summary
protected  AxisInterface m_axis
           
 
Constructor Summary
AbstractDimension(AxisInterface axis)
          Constructor.
 
Method Summary
 AxisInterface getAxis()
          Returns the axis that this dimension is a child of.
 HierarchyInterface[] getHierarchies(int index, int count)
          Returns the hierarchies associated with a given range of indices.
 LevelInterface[] getLevels(int index, int count)
          Returns the levels associated with a given range of indices.
 SimpleNodeInterface getNodeChild(int index)
          Alias for getHierarchy.
 int getNodeChildCount()
          Alias for getHierarchyCount.
 SimpleNodeInterface[] getNodeChildren(int index, int count)
          Alias for getHierarchies.
 String getNodeType()
          Returns the dimension's type.
 boolean isLeafNode()
          Returns false since dimensions parent hierarchies.
 
Methods inherited from class com.sas.mdtable.AbstractNode
getNodeExpandedText, getNodeText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sas.mdtable.DimensionInterface
getHierarchy, getHierarchyCount, getLevel, getLevelCount, getMetaDimension
 
Methods inherited from interface com.sas.mdtable.NodeInterface
getLabel, getName
 
Methods inherited from interface com.sas.models.NodeInterface
getNodeExpandedText, getNodeText
 
Methods inherited from interface com.sas.models.SimpleNodeInterface
countNodeChildren
 

Field Detail

m_axis

protected AxisInterface m_axis
Constructor Detail

AbstractDimension

public AbstractDimension(AxisInterface axis)
Constructor.
Parameters:
axis - The axis that parents this dimension; may be null.
Method Detail

getAxis

public final AxisInterface getAxis()
Returns the axis that this dimension is a child of.
Specified by:
getAxis in interface DimensionInterface
Returns:
The axis that parents this dimension; will be null if this is a meta-dimension.

getHierarchies

public HierarchyInterface[] getHierarchies(int index,
                                           int count)
                                    throws TableException
Returns the hierarchies associated with a given range of indices. The default implementation simply calls getHierarchy count-times; subclass should override if it can do so more efficiently.
Specified by:
getHierarchies in interface DimensionInterface
Parameters:
index - A zero-based hierarchy index (0 to getHierarchyCount()-1).
count - The number of hierarchies to return.
Returns:
An array whose first element is the hierarchy associated with index, whose second element is the hierarchy associated with index+1, and so on such that array[array.length-1] is the hierarchy associated with index+count-1.
Throws:
TableException - Thrown if the query can not be satisfied (e.g. i/o-failure).
IndexOutOfBoundsException - Thrown if index is negative, or greater than or equal to getHierarchyCount().

getLevels

public LevelInterface[] getLevels(int index,
                                  int count)
                           throws TableException
Returns the levels associated with a given range of indices. The default implementation simply calls getLevel count-times; subclass should override if it can do so more efficiently.
Specified by:
getLevels in interface DimensionInterface
Parameters:
index - A zero-based level index (0 to getLevelCount()-1).
count - The number of levels to return.
Returns:
An array whose first element is the level associated with index, whose second element is the level associated with index+1, and so on such that array[array.length-1] is the level associated with index+count-1.
Throws:
TableException - Thrown if the query can not be satisfied (e.g. i/o-failure).
IndexOutOfBoundsException - Thrown if index is negative, or greater than or equal to getLevelCount().

getNodeChild

public final SimpleNodeInterface getNodeChild(int index)
Alias for getHierarchy. If getHierarchy fails (throws TableException), NoSuchElementException is thrown.
Specified by:
getNodeChild in interface SimpleNodeInterface
Parameters:
index - A zero-based hierarchy index (0 to getHierarchyCount()-1).
Returns:
The hierarchy associated with index.
See Also:
DimensionInterface.getHierarchy(int)

getNodeChildCount

public final int getNodeChildCount()
Alias for getHierarchyCount. If getHierarchyCount fails (throws TableException), zero is returned.
Specified by:
getNodeChildCount in interface SimpleNodeInterface
Returns:
The number of hierarchies.
See Also:
DimensionInterface.getHierarchyCount()

getNodeChildren

public final SimpleNodeInterface[] getNodeChildren(int index,
                                                   int count)
Alias for getHierarchies. If getHierarchies fails (throws TableException), a zero-length array is returned.
Specified by:
getNodeChildren in interface SimpleNodeInterface
Parameters:
index - A zero-based hierarchy index (0 to getHierarchyCount()-1).
count - The number of hierarchies to return.
Returns:
An array whose first element is the hierarchy associated with index, whose second element is the hierarchy associated with index+1, and so on such that array[array.length-1] is the hierarchy associated with index+count-1.
See Also:
DimensionInterface.getHierarchies(int, int)

getNodeType

public String getNodeType()
Returns the dimension's type. The type serves to categorize a node, i.e. identify it as belonging to a particular group.
Specified by:
getNodeType in interface NodeInterface
Returns:
"dimension".

isLeafNode

public final boolean isLeafNode()
Returns false since dimensions parent hierarchies.
Specified by:
isLeafNode in interface SimpleNodeInterface
Returns:
False.




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