ec.gp.ge
Class GrammarRuleNode

java.lang.Object
  extended by ec.gp.ge.GrammarNode
      extended by ec.gp.ge.GrammarRuleNode

public class GrammarRuleNode
extends GrammarNode

A GrammarNode representing a Rule in the GE Grammar. The head of the GrammarRuleNode is the name of the rule; and the children are the various choices. These are returned by getChoice(...) and getNumChoices(). The merge(...) method unifies this GrammarRuleNode with the choices of another node.


Field Summary
 
Fields inherited from class ec.gp.ge.GrammarNode
children
 
Constructor Summary
GrammarRuleNode(java.lang.String head)
           
 
Method Summary
 void addChoice(GrammarNode choice)
          Adds a choice to the children of this node.
 GrammarNode getChoice(int index)
          Returns a given choice.
 int getNumChoices()
          Returns the current number of choices to the node.
 void merge(GrammarRuleNode other)
          Adds to this node all the choices of another node.
 java.lang.String toString()
           
 
Methods inherited from class ec.gp.ge.GrammarNode
getHead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GrammarRuleNode

public GrammarRuleNode(java.lang.String head)
Method Detail

addChoice

public void addChoice(GrammarNode choice)
Adds a choice to the children of this node.


getNumChoices

public int getNumChoices()
Returns the current number of choices to the node.


getChoice

public GrammarNode getChoice(int index)
Returns a given choice.


merge

public void merge(GrammarRuleNode other)
Adds to this node all the choices of another node.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object