com.sas.models
Class TreeNodeAdaptor

com.sas.models.TreeNodeAdaptor
All Implemented Interfaces:
com.sas.beans.PropertyChangeSource, com.sas.lang.ObjectDataInterface, ModelInterface, MutableNodeInterface, MutableSimpleNodeInterface, NodeInterface, SimpleNodeInterface, StaticNodeCellStyleInterface, StaticNodeCellStyleKeyInterface, StaticNodeStyleInterface, TreeInterface, TreeNodeInterface, TreeNodeV2Interface, java.io.Serializable

public class TreeNodeAdaptor

The TreeNodeAdaptor takes a NodeInterface and creates a TreeNodeAdaptor.

See Also:
Node, TreeNodeInterface, Serialized Form

Field Summary
protected  SimpleNodeInterface[] childArray
           
protected  OrderedCollection children
           
protected  NodeInterface node
           
protected  SimpleNodeInterface[] returnArray
           
 
Fields inherited from class com.sas.models.TreeNode
accessKey, border, borderSize, defaultImage, defaultImageAltText, description, expandedImage, expandedImageAltText, expandedState, lastNode, name, selectable, styleClass, styleKey, tabIndex, text, title, url
 
Fields inherited from class com.sas.models.Node
defaultNodeStyle, expandedNodeText, externalUpdateSupported, hasChildren, nodeStyle, nodeText, nodeType, objectData, RB_KEY
 
Constructor Summary
TreeNodeAdaptor(NodeInterface node)
          Constructor of TreeNodeAdaptor
TreeNodeAdaptor(NodeInterface node, java.lang.String name)
          Constructor of TreeNodeAdaptor
 
Method Summary
 void createChildArray()
          createChildArray creates an arrary of the node's children.
 SimpleNodeInterface getNodeChild(int i)
          getNodeChild returns the child at the specified index.
 int getNodeChildCount()
          getNodeChildCount() returns the number of children the curent node has.
 SimpleNodeInterface[] getNodeChildren(int startIndex, int count)
          getNodeChildren returns the array of requested children of a node.
 
Methods inherited from class com.sas.models.TreeNode
getAcessKey, getDefaultImage, getDefaultImageAltText, getDescription, getExpandedImage, getExpandedImageAltText, getName, getNodeCellStyleClass, getNodeCellStyleKey, getNodeExpandedText, getNodeText, getRootNodeName, getTabIndex, getText, getTitle, getURL, isExpanded, isLastNode, setAccessKey, setDefaultImage, setDefaultImageAltText, setDescription, setExpanded, setExpandedImage, setExpandedImageAltText, setLastNode, setName, setNodeCellStyleClass, setNodeCellStyleKey, setTabIndex, setText, setTitle, setURL
 
Methods inherited from class com.sas.models.Node
addItems, addNodeChild, addNodeChild, addPropertyChangeListener, attachView, countNodeChildren, detachView, firePropertyChange, firePropertyChange, getDefaultNodeStyle, getIndex, getNodeChildren, getNodeStyle, getNodeType, getNodeTypes, getObjectData, getRoot, isExternalUpdateSupported, isLeafNode, moveNodeChild, notifyPropertyChange, removeAllNodeChildren, removeNodeChild, removeNodeChild, removePropertyChangeListener, setDefaultNodeStyle, setExternalUpdateSupported, setNodeChildren, setNodeExpandedText, setNodeStyle, setNodeText, setNodeType, setObjectData, sort, toString
 
Methods inherited from interface com.sas.models.NodeInterface
getNodeType
 
Methods inherited from interface com.sas.models.SimpleNodeInterface
countNodeChildren, isLeafNode
 

Field Detail

children

protected OrderedCollection children

node

protected NodeInterface node

returnArray

protected SimpleNodeInterface[] returnArray

childArray

protected SimpleNodeInterface[] childArray
Constructor Detail

TreeNodeAdaptor

public TreeNodeAdaptor(NodeInterface node,
                       java.lang.String name)
Constructor of TreeNodeAdaptor

Parameters:
node - a NodeInteface which is used to create the adapted node
name - the name of the TreeNodeAdaptor

TreeNodeAdaptor

public TreeNodeAdaptor(NodeInterface node)
Constructor of TreeNodeAdaptor

Parameters:
node - a NodeInteface which is used to create the adapted node
Method Detail

getNodeChildCount

public int getNodeChildCount()
getNodeChildCount() returns the number of children the curent node has.

Specified by:
getNodeChildCount in interface SimpleNodeInterface
Overrides:
getNodeChildCount in class Node
Returns:
the number of children or 0 if no children

createChildArray

public void createChildArray()
createChildArray creates an arrary of the node's children. The array is created once and used by getNodeChildren and getNodeChild.


getNodeChild

public SimpleNodeInterface getNodeChild(int i)
getNodeChild returns the child at the specified index.

Specified by:
getNodeChild in interface SimpleNodeInterface
Overrides:
getNodeChild in class Node
Parameters:
i - the 0-based index of the child to get
Returns:
the child node object (as type SimpleNodeInterface) at the specified index.
See Also:
Node.getNodeChildren(int, int), Node.setNodeChildren(com.sas.collection.StaticOrderedCollectionInterface)

getNodeChildren

public SimpleNodeInterface[] getNodeChildren(int startIndex,
                                             int count)
getNodeChildren returns the array of requested children of a node.

Specified by:
getNodeChildren in interface SimpleNodeInterface
Overrides:
getNodeChildren in class Node
Parameters:
startIndex - 0-based index which identifies the start of the range
count - the amount of children to get
Returns:
an array of child node objects (as type SimpleNodeInterface) for the specified range
See Also:
Node.getNodeChild(int), Node.setNodeChildren(com.sas.collection.StaticOrderedCollectionInterface)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.