org.encog.ml.tree.traverse.tasks
Class TaskCountNodes
- java.lang.Object
-
- org.encog.ml.tree.traverse.tasks.TaskCountNodes
-
- All Implemented Interfaces:
- TreeTraversalTask
public class TaskCountNodes extends java.lang.Object implements TreeTraversalTask
Count the nodes in an acyclic tree.
-
-
Constructor Summary
Constructors Constructor and Description TaskCountNodes()Construct the task.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetNodeCount()static intprocess(TreeNode node)Count the nodes from this tree node.voidsetNodeCount(int nodeCount)Set the current node count.booleantask(TreeNode node)
-
-
-
Method Detail
-
task
public boolean task(TreeNode node)
- Specified by:
taskin interfaceTreeTraversalTask- Parameters:
node- The node visiting.- Returns:
- True, if traversal should continue.
-
getNodeCount
public int getNodeCount()
- Returns:
- The current node count.
-
setNodeCount
public void setNodeCount(int nodeCount)
Set the current node count.- Parameters:
nodeCount- The node count.
-
process
public static int process(TreeNode node)
Count the nodes from this tree node.- Parameters:
node- The tree node.- Returns:
- The node count.
-
-
DMelt 3.0 © DataMelt by jWork.ORG