|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<TreeNode<E>>
Util.Structures.TreeNode<E>
public class TreeNode<E>
Node for use in the nimble tree structure. Has a parent and data. Is an array list
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
TreeNode()
Creates a new instance of TreeNode |
|
TreeNode(TreeNode<E> copy)
Copy constructor |
|
TreeNode(TreeNode<E> parent,
E data)
Create node with parent and data |
|
TreeNode(TreeNode<E> copy,
TreeNode<E> parent)
|
Method Summary | |
---|---|
boolean |
add(TreeNode<E> child)
Adds a child node to this node. |
java.lang.String |
collapse()
Collapse the node to a string |
E |
getData()
Get data in node |
int |
getDepth()
Get depth of this node in the tree |
TreeNode<E> |
getEnd()
Get the last node |
int |
getID()
|
int |
getInfo()
|
int |
getMaxDepth()
|
TreeNode<E> |
getParent()
Get parent node |
static void |
main(java.lang.String[] args)
|
void |
setData(E data)
Set data in node |
void |
setDepth(int i)
Set depth of this node and it's children |
void |
setID(int id)
|
void |
setInfo(int info)
|
void |
setParent(TreeNode<E> tn)
Set parent node |
java.lang.String |
toString()
Build the string using a textural tree-view |
Methods inherited from class java.util.ArrayList |
---|
add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
---|
public TreeNode()
public TreeNode(TreeNode<E> parent, E data)
parent
- node parentdata
- node datapublic TreeNode(TreeNode<E> copy)
copy
- node to copypublic TreeNode(TreeNode<E> copy, TreeNode<E> parent)
Method Detail |
---|
public boolean add(TreeNode<E> child)
add
in interface java.util.Collection<TreeNode<E>>
add
in interface java.util.List<TreeNode<E>>
add
in class java.util.ArrayList<TreeNode<E>>
child
- the child node to addpublic TreeNode<E> getParent()
public void setParent(TreeNode<E> tn)
tn
- parent nodepublic E getData()
public void setData(E data)
data
- node datapublic int getInfo()
public void setInfo(int info)
public int getID()
public void setID(int id)
public void setDepth(int i)
i
- depthpublic int getMaxDepth()
public int getDepth()
public TreeNode<E> getEnd()
public java.lang.String collapse()
public java.lang.String toString()
toString
in class java.util.AbstractCollection<TreeNode<E>>
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |