com.sas.models
Interface SimpleNodeInterface

All Known Subinterfaces:
MDSelectorMenuItemNodeInterface, MenuBarNodeInterface, MenuItemNodeInterface, MenuNodeInterface, MutableNodeInterface, NodeIconInterface, NodeInterface, SelectorMenuItemNodeInterface, SelectorMenuItemNodeV2Interface, ServerNodeInterface, TreeNodeInterface, TreeNodeV2Interface
All Known Implementing Classes:
_rprxJ2ServerNode, _rprxRemoteDesignTimeServerNode, _rprxRemoteServerNodeClient, ActionNode, ClassNode, Color, ColorList, DefaultColorList, DefaultFontList, File, FileList, FileSystem, FileSystemList, Font, FontList, IMDBTable, LevelTreeNode, MDSelectorMenuItemNode, MenuBarNode, MenuItemNode, MenuNode, Node, NodeDelegate, NodeIcon, NodeView, NodeView, Printer, PrinterList, ProgressiveLevelTreeNode, SASListNode, SelectorMenuItemNode, ServerNodeDelegate, TreeNode, TreeNodeAdaptor

public interface SimpleNodeInterface

SimpleNodeInterface is an interface which defines methods to navigate down a hierarchy. The node retrieval methods use 0-based indexing for node indexes.


Method Summary
abstract  int countNodeChildren(int maximumChildCount)
          Counts the children of the current node.
abstract  SimpleNodeInterface getNodeChild(int index)
          Returns the child node at the specified index.
abstract  int getNodeChildCount()
          Returns the number of children.
abstract  SimpleNodeInterface[] getNodeChildren(int startIndex, int count)
          Returns the specified range of children for the current node.
abstract  boolean isLeafNode()
          Indicates whether the current node is a leaf.
 

Method Detail

countNodeChildren

int countNodeChildren(int maximumChildCount)
Counts the children of the current node. countNodeChildren differs from getNodeChildCount when the number of children is unknown, i.e. when getNodeChildCount returns -1. If your implementation of getNodeChildCount never returns -1, then simply define countNodeChildren as a return of getNodeChildCount, otherwise read-on.

countNodeChildren is an instruction to determine the number of children even though that number is not readily known. To limit the potential overhead of this determination, the maximum number of children to read may be specified.

Parameters:
maxCount - Maximum number of children to read, or 0 to read indefinitely. Implementations where the number of children is always known should ignore this parameter. In cases where the total number of children is unknown, but the number known so far is greater than maxCount should return the larger known number. Thus maxCount is only used as a limiting factor when the implementation has to actually do computation (e.g. fetch observations).
Returns:
The number of children known to be available.

getNodeChildCount

int getNodeChildCount()
Returns the number of children. If the number of children is unknown, -1 should be returned.

Returns:
the number of children or -1 if unknown

isLeafNode

boolean isLeafNode()
Indicates whether the current node is a leaf. A value of true indicates that the current node is a leaf and hence will not have any children.

Returns:
true if the current node is a leaf, otherwise false

getNodeChild

SimpleNodeInterface getNodeChild(int index)
Returns the child node at the specified index. If the leafNode property value is true then this method should return null.

Parameters:
index - the 0-based index of the child node to retrieve
Returns:
the child at index or null if the leafNode property value is true.

getNodeChildren

SimpleNodeInterface[] getNodeChildren(int startIndex,
                                      int count)
Returns the specified range of children for the current node. If there are less children than are queried for, an implementation can return an array whose size if representative of the actual number of children being returned or an array whose size is the same as the number of children asked for. If the resulting array's size is the same as the number asked for and there are fewer children returned than asked for the implementation should assign the unused values in the array to null. If the leafNode property value is true then this method should return null.

Parameters:
startIndex - 0-based index which identifies the start of the range
count - the amount of children to get
Returns:
an array containing the specified range of children or null if the leafNode property value is true.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.