ec.gp.ge
Class GrammarRuleNode
- java.lang.Object
-
- ec.gp.ge.GrammarNode
-
- ec.gp.ge.GrammarRuleNode
-
- All Implemented Interfaces:
- java.io.Serializable
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.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description GrammarRuleNode(java.lang.String head)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddChoice(GrammarNode choice)Adds a choice to the children of this node.GrammarNodegetChoice(int index)Returns a given choice.intgetNumChoices()Returns the current number of choices to the node.voidmerge(GrammarRuleNode other)Adds to this node all the choices of another node.java.lang.StringtoString()A better toString() function -- khaled-
Methods inherited from class ec.gp.ge.GrammarNode
equals, getHead, hashCode
-
-
-
-
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()
A better toString() function -- khaled- Specified by:
toStringin classGrammarNode
-
-
DMelt 3.0 © DataMelt by jWork.ORG