com.sas.swing.models
Class IndexedMutableTreeNode

com.sas.swing.models.IndexedMutableTreeNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
Direct Known Subclasses:
JDBCToTreeViewModelAdapter.LevelTreeNode

public class IndexedMutableTreeNode

A javax.swing.tree.DefaultMutableTreeNode that stores an index value along with an object.

See Also:
Serialized Form

Field Summary
protected  boolean childrenRead
          Whether or not the node has its children read
protected  int index
          Index of node within tree
protected  int nextRelativeIndex
          Index of next relative from current or previous generation within tree
 
Constructor Summary
IndexedMutableTreeNode()
          Creates a tree node that has no parent and no children and an index of 0, but which allows children.
IndexedMutableTreeNode(int index, java.lang.Object userObject)
          Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object and given index.
IndexedMutableTreeNode(int index, java.lang.Object userObject, boolean allowsChildren)
          Creates a tree node with no parent, no children, initialized with the specified user object and given index, and that allows children only if specified.
 
Method Summary
 int getIndex()
          Returns the index of the node
 int getNextRelativeIndex()
          Returns the index of next relative from current or previous generation within tree
 boolean isChildrenRead()
          Returns whether the children have been read
 void setChildrenRead(boolean childrenRead)
          Sets whether the children have been read
 void setNextRelativeIndex(int nextRelativeIndex)
          Sets the index of next relative from current or previous generation within tree
 

Field Detail

index

protected int index
Index of node within tree


nextRelativeIndex

protected int nextRelativeIndex
Index of next relative from current or previous generation within tree


childrenRead

protected boolean childrenRead
Whether or not the node has its children read

Constructor Detail

IndexedMutableTreeNode

public IndexedMutableTreeNode()
Creates a tree node that has no parent and no children and an index of 0, but which allows children.


IndexedMutableTreeNode

public IndexedMutableTreeNode(int index,
                              java.lang.Object userObject)
Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object and given index.

Parameters:
index - index of the node within the tree
userObject - an Object provided by the user that constitutes the node's data

IndexedMutableTreeNode

public IndexedMutableTreeNode(int index,
                              java.lang.Object userObject,
                              boolean allowsChildren)
Creates a tree node with no parent, no children, initialized with the specified user object and given index, and that allows children only if specified.

Parameters:
index - index of the node within the tree
userObject - an Object provided by the user that constitutes the node's data
allowsChildren - if true, the node is allowed to have child nodes -- otherwise, it is always a leaf node
Method Detail

getIndex

public int getIndex()
Returns the index of the node


isChildrenRead

public boolean isChildrenRead()
Returns whether the children have been read


setChildrenRead

public void setChildrenRead(boolean childrenRead)
Sets whether the children have been read


getNextRelativeIndex

public int getNextRelativeIndex()
Returns the index of next relative from current or previous generation within tree


setNextRelativeIndex

public void setNextRelativeIndex(int nextRelativeIndex)
Sets the index of next relative from current or previous generation within tree




Copyright © 2009 SAS Institute Inc. All Rights Reserved.