|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjasi.sim.basic.tree.AbstractNode<T>
T - Content type of node.public abstract class AbstractNode<T>
Abstract base node class.
| Constructor Summary | |
|---|---|
AbstractNode()
Create a root node with no leafs and no content. |
|
AbstractNode(T content)
Create a root node with no leafs. |
|
| Method Summary | |
|---|---|
abstract AbstractNode<T> |
add(AbstractNode<T> child)
Add a node as child to this node. |
boolean |
equals(java.lang.Object node)
Test this node with that node for equality by comparing their content. |
java.util.Collection<AbstractNode<T>> |
findChildren(T content)
Get all children with a given content. |
AbstractNode<T> |
findRoot()
Get this node's root node. |
abstract java.util.Collection<AbstractNode<T>> |
getChildren()
Get all children of this node. |
T |
getContent()
Get this node's content. |
AbstractNode<T> |
getParent()
Get this node's parent. |
boolean |
has(AbstractNode<T> child)
Check, if this node contains that child node. |
boolean |
hasChild(T content)
Check, if this node contains that child node. |
int |
hashCode()
Return a hash code value. |
boolean |
hasParent()
Check, if this node has a parent node. |
boolean |
isLeafNode()
Check, if this node has no children. |
boolean |
isRootNode()
Check, if this node has no parent node. |
java.lang.String |
printTree(AbstractNode<T> current)
Print this node in a tree. |
java.lang.String |
printTree(int level,
AbstractNode<T> current)
Print this node in a tree. |
abstract void |
remove(AbstractNode<T> child)
Remove a child node. |
abstract java.util.Collection<AbstractNode<T>> |
remove(T content)
Remove a child node. |
java.util.Collection<AbstractNode<T>> |
removeAll()
Remove a all children. |
void |
setChildren(java.util.Collection<AbstractNode<T>> children)
Set all children of this node. |
void |
setContent(T content)
Set this node's content. |
void |
setParent(AbstractNode<T> parent)
Set this node's parent. |
abstract int |
size()
Get the number of children nodes of this node. |
java.lang.String |
toString()
Get string representation of this node. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractNode()
public AbstractNode(T content)
content - The node's content.| Method Detail |
|---|
public final T getContent()
public final void setContent(T content)
content - The content.public final AbstractNode<T> getParent()
public final void setParent(AbstractNode<T> parent)
parent - The parent.public final boolean hasParent()
public abstract java.util.Collection<AbstractNode<T>> getChildren()
public final void setChildren(java.util.Collection<AbstractNode<T>> children)
children - The children.public final boolean isRootNode()
public final boolean isLeafNode()
public abstract int size()
public abstract AbstractNode<T> add(AbstractNode<T> child)
child - The new child node.
public abstract java.util.Collection<AbstractNode<T>> remove(T content)
content - The content of the child node.
public abstract void remove(AbstractNode<T> child)
child - The child node.public java.util.Collection<AbstractNode<T>> removeAll()
public final java.util.Collection<AbstractNode<T>> findChildren(T content)
content - The content of the children.
public final boolean hasChild(T content)
content - That child node's content.
public final boolean has(AbstractNode<T> child)
child - That child node.
public final AbstractNode<T> findRoot()
public final boolean equals(java.lang.Object node)
equals in class java.lang.Objectnode - That node.
public final int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public final java.lang.String printTree(AbstractNode<T> current)
current - The current node of the tree
public final java.lang.String printTree(int level,
AbstractNode<T> current)
level - The current tree level.current - The current node of the tree
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||