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.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TaskReplaceNode(TreeNode theReplaceThisNode, TreeNode theReplaceWith)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `TreeNode` | `getReplaceThisNode()`
    `TreeNode` | `getReplaceWith()`
    `static void` | `process(TreeNode rootNode, TreeNode replaceThisNode, TreeNode replaceWith)` Replace one node with another.
    `boolean` | `task(TreeNode node)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TaskReplaceNode

          public TaskReplaceNode(TreeNode theReplaceThisNode,
                         TreeNode theReplaceWith)

  - ### Method Detail

    - #### 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.