|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.student.common.ui.client.widgets.table.Node<T>
public class Node<T>
A generic tree node.
Field Summary | |
---|---|
(package private) List<Node> |
childrenList
Children are stored in a list |
(package private) String |
id
|
(package private) Node |
parent
Parent Node. |
(package private) T |
userObject
User Object |
Constructor Summary | |
---|---|
Node()
Empty, default constructor |
|
Node(T obj)
Constructor of Node which accepts the user object |
Method Summary | |
---|---|
void |
addNode(Node node)
Add one child and set child's parent to current node |
List<Node> |
children()
|
Node<T> |
clone()
|
List<Node> |
deepTrans(Node root)
|
List<Node<T>> |
getAllChildren()
Return all children and grand children |
int |
getAllLeafCount()
Returns the total number of leaves that are descendants of this node. |
Node |
getChildAt(int index)
Get the child at index |
int |
getChildCount()
Return the child count |
int |
getDistance(Node node)
|
Node<T> |
getFirstLeafDescendant()
Get the first leaf among all its children |
int |
getIndex(Node aChild)
|
List<Node> |
getLeafChildren()
|
List<Node> |
getLeafSiblings()
|
int |
getMaxLevelDistance()
|
List<Node> |
getNonLeafChildren()
Return all non-leaf children |
Node |
getParent()
Get the parent of current node |
List<Node> |
getSiblings()
|
T |
getUserObject()
Get the user object from node |
boolean |
isLeaf()
If it has no children, it is a leaf |
boolean |
isNodeChild(Node aNode)
Is passed node a child of current node |
boolean |
isNodeSibling(Node anotherNode)
Is parsed in node a sibling |
static void |
main(String[] argv)
|
void |
remove(int childIndex)
Remove child at childIndex |
void |
remove(Node child)
Remove child from children list |
void |
removeAllChildren()
|
void |
removeFromParent()
Remove child from parent |
void |
setParent(Node parent)
Set the Parent node for current node |
void |
setUserObject(T obj)
Set the user object to this node |
List<List<Node>> |
toLevel()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
List<Node> childrenList
Node parent
T userObject
String id
Constructor Detail |
---|
public Node()
public Node(T obj)
obj
- user objectMethod Detail |
---|
public T getUserObject()
public void setUserObject(T obj)
obj
- obj must be an instanceo of type Tpublic void setParent(Node parent)
parent
- new parentpublic Node getParent()
public void addNode(Node node)
node
- new childpublic boolean isLeaf()
public int getChildCount()
public Node getChildAt(int index)
index
- the index of the child
public void removeFromParent()
public void remove(int childIndex)
childIndex
- child indexspublic void remove(Node child)
child
- public void removeAllChildren()
public boolean isNodeChild(Node aNode)
aNode
- public int getIndex(Node aChild)
public boolean isNodeSibling(Node anotherNode)
public int getAllLeafCount()
public List<Node<T>> getAllChildren()
public Node<T> getFirstLeafDescendant()
public List<Node> getNonLeafChildren()
public List<Node> getLeafChildren()
public List<Node> getSiblings()
public List<Node> getLeafSiblings()
public List<Node> children()
public List<List<Node>> toLevel()
public List<Node> deepTrans(Node root)
public int getMaxLevelDistance()
public int getDistance(Node node)
public String toString()
toString
in class Object
public Node<T> clone()
clone
in class Object
public static void main(String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |