jasi.sim.basic.tree
Class ListNode<T>

java.lang.Object
  extended by jasi.sim.basic.tree.AbstractNode<T>
      extended by jasi.sim.basic.tree.ListNode<T>
Type Parameters:
T - Content type of node.

public final class ListNode<T>
extends AbstractNode<T>

A node class, which can have multiple entries of child node with the same ID.


Constructor Summary
ListNode()
          Create a root node with no leafs and no content.
ListNode(T content)
          Create a root node with no leafs.
 
Method Summary
 AbstractNode<T> add(AbstractNode<T> child)
          Add a node as child to this node.
 java.util.Collection<AbstractNode<T>> getChildren()
          Get all children of this node.
 void remove(AbstractNode<T> child)
          Remove a child node.
 java.util.Collection<AbstractNode<T>> remove(T content)
          Remove child nodes from this node.
 int size()
          Get the number of children nodes of this node.
 
Methods inherited from class jasi.sim.basic.tree.AbstractNode
equals, findChildren, findRoot, getContent, getParent, has, hasChild, hashCode, hasParent, isLeafNode, isRootNode, printTree, printTree, removeAll, setChildren, setContent, setParent, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListNode

public ListNode()
Create a root node with no leafs and no content.


ListNode

public ListNode(T content)
Create a root node with no leafs.

Parameters:
content - The node's content.
Method Detail

size

public int size()
Get the number of children nodes of this node.

Specified by:
size in class AbstractNode<T>
Returns:
The number of children.
See Also:
AbstractNode.size()

add

public AbstractNode<T> add(AbstractNode<T> child)
Add a node as child to this node.

Specified by:
add in class AbstractNode<T>
Parameters:
child - The new child node.
Returns:
The child node.

remove

public java.util.Collection<AbstractNode<T>> remove(T content)
Remove child nodes from this node.

Specified by:
remove in class AbstractNode<T>
Parameters:
content - The content of the child nodes.
Returns:
The children.

remove

public void remove(AbstractNode<T> child)
Remove a child node.

Specified by:
remove in class AbstractNode<T>
Parameters:
child - The child node.
See Also:
AbstractNode.remove(AbstractNode)

getChildren

public java.util.Collection<AbstractNode<T>> getChildren()
Get all children of this node.

Specified by:
getChildren in class AbstractNode<T>
Returns:
The children.
See Also:
AbstractNode.getChildren()