org.encog.ml.tree.traverse.tasks
Class TaskReplaceNode
java.lang.Object
org.encog.ml.tree.traverse.tasks.TaskReplaceNode
- All Implemented Interfaces:
- TreeTraversalTask
public class TaskReplaceNode
- extends Object
- implements TreeTraversalTask
Task to replace a node.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TaskReplaceNode
public TaskReplaceNode(TreeNode theReplaceThisNode,
TreeNode theReplaceWith)
getReplaceThisNode
public TreeNode getReplaceThisNode()
- Returns:
- The node to replace.
getReplaceWith
public TreeNode getReplaceWith()
- Returns:
- What to replace with.
task
public boolean task(TreeNode node)
-
- Specified by:
task
in interface TreeTraversalTask
- Parameters:
node
- The node visiting.
- Returns:
- True, if traversal should continue.
process
public static void process(TreeNode rootNode,
TreeNode replaceThisNode,
TreeNode replaceWith)
- Replace one node with another.
- Parameters:
rootNode
- The root node.replaceThisNode
- The node to replace.replaceWith
- What to replace with.
Copyright © 2014. All Rights Reserved.