gap
Class GPTerminal

java.lang.Object
  |
  +--gap.GPFunction
        |
        +--gap.GPTerminal
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public abstract class GPTerminal
extends GPFunction
implements java.lang.Cloneable, java.io.Serializable

Terminal function. Leaf of a program tree.

Each subclass must also override clone() <\P>

Author:
Pietro Berkes, Samuele Pedroni
See Also:
Serialized Form

Fields inherited from class gap.GPFunction
arg, father, idx, NO_TYPE, SPECIAL
 
Constructor Summary
GPTerminal()
           
 
Method Summary
 int[] getCompatibility(int arg_no)
          Grammatical rules.
 int getNArgs()
          Return the number of arguments.
 java.lang.String prettyPrint(java.lang.String ident)
          Return a string representation of the function and its children.
 java.lang.String toString()
          Return the name of the function, extracted from the class name.
 
Methods inherited from class gap.GPFunction
compile, deepClone, exec, getObjArgTypeName, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GPTerminal

public GPTerminal()
Method Detail

getCompatibility

public int[] getCompatibility(int arg_no)
Grammatical rules. Each argument must accept at least one type of terminal.
Overrides:
getCompatibility in class GPFunction
Returns:
Array of accepted types. null if all types accepted.

getNArgs

public int getNArgs()
Description copied from class: GPFunction
Return the number of arguments.
Overrides:
getNArgs in class GPFunction
Returns:
No. of arguments

toString

public java.lang.String toString()
Description copied from class: GPFunction
Return the name of the function, extracted from the class name.
Overrides:
toString in class GPFunction

prettyPrint

public java.lang.String prettyPrint(java.lang.String ident)
Description copied from class: GPFunction
Return a string representation of the function and its children.
Overrides:
prettyPrint in class GPFunction