public class Tree extends TreeNode
Tree
s, subject to the following
restrictions:
TreeNode
.Modifier and Type | Field and Description |
---|---|
static java.lang.Integer |
SORT_BY_DATA
A constant for sorting tress by data field of the nodes
|
static java.lang.Integer |
SORT_BY_NAME
A constant for sorting trees by the name of the nodes
|
static java.lang.Integer |
SORT_BY_NODE_ID
A constant for sorting trees by the ID of the nodes
|
Constructor and Description |
---|
Tree() |
Modifier and Type | Method and Description |
---|---|
Tree[] |
getChildren()
Get the children of this node.
|
void |
populateTree(java.lang.Object[] data_)
Convenience method to populate the node data of nodes in this tree.
|
java.lang.Object[] |
retrieveTreeData()
Convenience method to obtain a flat represention of the data in the tree.
|
java.lang.Integer[] |
retrieveTreeDepths()
Convenience method to obtain a flat represention of the depths of the
nodes in the tree.
|
java.lang.Long[] |
retrieveTreeIds()
Convenience method to obtain a flat represention of the tree.
|
java.lang.String[] |
retrieveTreeNames()
Convenience method to obtain a flat represention of the names of the tree
nodes.
|
void |
setChildren(Tree[] children_)
Set the children of this node.
|
public static final java.lang.Integer SORT_BY_NODE_ID
public static final java.lang.Integer SORT_BY_NAME
public static final java.lang.Integer SORT_BY_DATA
public Tree[] getChildren()
setChildren(Tree[])
public void setChildren(Tree[] children_)
children_
- an array of child treesgetChildren()
public java.lang.Long[] retrieveTreeIds()
populateTree(java.lang.Object[])
. This order is known as
preorder, which means that the root node is visited before any
of its children.public java.lang.Object[] retrieveTreeData()
populateTree(java.lang.Object[])
. This order is
known as preorder, which means that the root node is visited before
any of its children.public java.lang.String[] retrieveTreeNames()
populateTree(java.lang.Object[])
. This order is
known as preorder, which means that the root node is visited before
any of its children.public java.lang.Integer[] retrieveTreeDepths()
populateTree(java.lang.Object[])
. This order is
known as preorder, which means that the root node is visited
before any of its children.public void populateTree(java.lang.Object[] data_)
retrieveTreeIds()
. This order is known
as preorder, which means that the root node is visited before any
of its children.data_
- A one-dimensional array of data to use to populate tree.Copyright © 2003-2024 Appian Corporation. All Rights Reserved.