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

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

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

A node class, where children must possess different IDs.


Constructor Summary
SetNode()
          Create a root node with no leafs and no content.
SetNode(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 a child node from this node.
 java.util.Collection<AbstractNode<T>> removeAll()
          Remove a all children.
 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, setChildren, setContent, setParent, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SetNode

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


SetNode

public SetNode(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.

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 a child node from this node.

Specified by:
remove in class AbstractNode<T>
Parameters:
content - The content of the child node.
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)

removeAll

public java.util.Collection<AbstractNode<T>> removeAll()
Remove a all children.

Overrides:
removeAll in class AbstractNode<T>
Returns:
The children.

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()