com.sas.swing.visuals.mdtable
Class AbstractHierarchy
java.lang.Object
|
+--com.sas.swing.visuals.mdtable.AbstractNode
|
+--com.sas.swing.visuals.mdtable.AbstractHierarchy
- All Implemented Interfaces:
- HierarchyInterface, NodeInterface, NodeInterface, SimpleNodeInterface
- public abstract class AbstractHierarchy
- extends AbstractNode
- implements HierarchyInterface
Defines an abstract base class for an implementation of HierarchyInterface.
- See Also:
AbstractAxis,
AbstractDimension,
AbstractLevel,
AbstractMember
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractHierarchy
public AbstractHierarchy(DimensionInterface dimension)
- Constructor.
- Parameters:
dimension - The dimension that parents this hierarchy.
getDimension
public final DimensionInterface getDimension()
- Returns the dimension that this hierarchy is a child of.
- Specified by:
getDimension in interface HierarchyInterface
- Returns:
- The dimension that parents this hierarchy.
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 HierarchyInterface
- 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 getLevel.
If getLevel fails (throws TableException),
NoSuchElementException is thrown.
- Specified by:
getNodeChild in interface SimpleNodeInterface
- Parameters:
index - A zero-based level index (0 to getLevelCount()-1).- Returns:
- The level associated with index.
- See Also:
HierarchyInterface.getLevel(int)
getNodeChildCount
public final int getNodeChildCount()
- Alias for getLevelCount.
If getLevelCount fails (throws TableException), zero is returned.
- Specified by:
getNodeChildCount in interface SimpleNodeInterface
- Returns:
- The number of levels.
- See Also:
HierarchyInterface.getLevelCount()
getNodeChildren
public final SimpleNodeInterface[] getNodeChildren(int index,
int count)
- Alias for getLevels.
If getLevels fails (throws TableException),
a zero-length array is returned.
- Specified by:
getNodeChildren in interface SimpleNodeInterface
- 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.
- See Also:
HierarchyInterface.getLevels(int, int)
getNodeType
public String getNodeType()
- Returns the hierarchy'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:
- "hierarchy".
isLeafNode
public final boolean isLeafNode()
- Returns false since hierarchies parent levels.
- Specified by:
isLeafNode in interface SimpleNodeInterface
- Returns:
- False.
Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Thu, 16 Feb 2006 02:19:56