|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.groovyj.jgprog.Function
|
+--com.groovyj.jgprog.functions.Argument
Represents an argument on a chromosome. World-creators should not use this class. Instances are generated automatically by chromosomes.
Copyright (c) 2000 Robert Baruch. This code is released under the GNU General Public License (GPL).
| Fields inherited from class com.groovyj.jgprog.Function |
arity, individual, returnType |
| Method Summary | |
static Argument |
create(int num,
int chromosomeNum,
Type type)
Creates an instance of an Argument. |
boolean |
execute_boolean(Chromosome c,
int n)
Executes this node as a boolean. |
double |
execute_double(Chromosome c,
int n)
Executes this node as a double. |
float |
execute_float(Chromosome c,
int n)
Executes this node as a float. |
int |
execute_int(Chromosome c,
int n)
Executes this node as an integer. |
long |
execute_long(Chromosome c,
int n)
Executes this node as a long. |
java.lang.Object |
execute_object(Chromosome c,
int n)
Executes this node as an object. |
java.lang.Object |
get()
Gets the value of this argument. |
static java.lang.Object |
get(int num)
Gets the value of an argument without having to obtain a reference to the argument. |
static Argument |
getArgument(int num,
int chromosomeNum)
Gets the one instance of a numbered argument. |
Type |
getChildType(int num)
Gets the type of node allowed form the given child number. |
java.lang.String |
getName()
Gets the name of this node. |
boolean |
isConstant()
|
static java.lang.Object[] |
newFrame(int n)
Creates a new stack frame consisting of a number of arguments. |
static void |
restoreFrame()
Restores the previous stack frame. |
static void |
set(int num,
java.lang.Object value)
Sets an argument without having to obtain a reference to the argument. |
void |
set(java.lang.Object value)
Sets the value of this argument. |
| Methods inherited from class com.groovyj.jgprog.Function |
execute_void, execute, getArity, getReturnType, setIndividual, setReturnType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static Argument create(int num,
int chromosomeNum,
Type type)
get or
getArgument.num - the number of the Argument to createchromosomeNum - the number of chromosome this Argument belongs tothe - type of this Argumentpublic java.lang.String getName()
FunctiongetName in class Functioncom.groovyj.jgprog.Functionpublic static java.lang.Object[] newFrame(int n)
n - the number of arguments the new frame should containpublic static void restoreFrame()
public static void set(int num,
java.lang.Object value)
num - the number of the argument to setvalue - the value to set the argument withpublic static java.lang.Object get(int num)
num - the number of the argument to get
public static Argument getArgument(int num,
int chromosomeNum)
num - the number of the argument to getchromosomeNum - the number of the chromosome from which to get the argumentpublic void set(java.lang.Object value)
value - the value to set this argument withpublic java.lang.Object get()
public boolean execute_boolean(Chromosome c,
int n)
Functionexecute_boolean in class Functioncom.groovyj.jgprog.FunctionUnsupportedOperationException - if the type of this node is not boolean
public int execute_int(Chromosome c,
int n)
Functionexecute_int in class Functioncom.groovyj.jgprog.FunctionUnsupportedOperationException - if the type of this node is not integer
public long execute_long(Chromosome c,
int n)
Functionexecute_long in class Functioncom.groovyj.jgprog.FunctionUnsupportedOperationException - if the type of this node is not long
public float execute_float(Chromosome c,
int n)
Functionexecute_float in class Functioncom.groovyj.jgprog.FunctionUnsupportedOperationException - if the type of this node is not float
public double execute_double(Chromosome c,
int n)
Functionexecute_double in class Functioncom.groovyj.jgprog.FunctionUnsupportedOperationException - if the type of this node is not double
public java.lang.Object execute_object(Chromosome c,
int n)
Functionexecute_object in class Functioncom.groovyj.jgprog.FunctionUnsupportedOperationException - if the type of this node is not objectpublic Type getChildType(int num)
FunctiongetChildType in class Functioncom.groovyj.jgprog.Functioni - the child numberpublic boolean isConstant()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||