com.sas.mdtable
Class AbstractLevel

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

public abstract class AbstractLevel
extends AbstractNode
implements LevelInterface

Defines an abstract base class for an implementation of LevelInterface.

See Also:
AbstractAxis, AbstractDimension, AbstractHierarchy, AbstractMember

Constructor Summary
AbstractLevel(DimensionInterface dimension)
          Constructor.
 
Method Summary
 DimensionInterface getDimension()
          Returns the dimension that this level is a child of.
 MemberInterface[] getMembers(int index, int count)
          Returns the members associated with a given range of indices.
 SimpleNodeInterface getNodeChild(int index)
          Alias for getMember.
 int getNodeChildCount()
          Alias for getMemberCount.
 SimpleNodeInterface[] getNodeChildren(int index, int count)
          Alias for getMembers.
 String getNodeType()
          Returns the level's type.
 boolean isLeafNode()
          Returns false since levels parent members.
 
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.LevelInterface
getMember, getMemberCount, getMetaLevel
 
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
 

Constructor Detail

AbstractLevel

public AbstractLevel(DimensionInterface dimension)
Constructor.
Parameters:
dimension - The dimension that parents this level.
Method Detail

getDimension

public final DimensionInterface getDimension()
Returns the dimension that this level is a child of.
Specified by:
getDimension in interface LevelInterface
Returns:
The dimension that parents this level.

getMembers

public MemberInterface[] getMembers(int index,
                                    int count)
                             throws TableException
Returns the members associated with a given range of indices. The default implementation simply calls getMember count-times; subclass should override if it can do so more efficiently.
Specified by:
getMembers in interface LevelInterface
Parameters:
index - A zero-based member index (0 to getMemberCount()-1).
count - The number of members to return.
Returns:
An array whose first element is the member associated with index, whose second element is the member associated with index+1, and so on such that array[array.length-1] is the member 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 getMemberCount().

getNodeChild

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

getNodeChildCount

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

getNodeChildren

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

getNodeType

public String getNodeType()
Returns the level'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:
"level".

isLeafNode

public final boolean isLeafNode()
Returns false since levels parent members.
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