com.groovyj.jgprog.functions
Class Loop
java.lang.Object
|
+--com.groovyj.jgprog.Function
|
+--com.groovyj.jgprog.functions.Loop
- All Implemented Interfaces:
- java.io.Serializable
- public class Loop
- extends Function
- implements java.io.Serializable
Do something a number of times. This function's first child
is an integer which tells how many times to execute the second (void)
child. The number of times is limited to between 0 and 10 inclusive.
Copyright (c) 2000 Robert Baruch. This code is released under
the GNU General Public License (GPL).
- Version:
- $Id: Loop.java,v 1.1 2000/10/12 15:19:39 groovyjava Exp $
- Author:
- Robert Baruch (jgprog@sourceforge.net)
- See Also:
- Serialized Form
Constructor Summary |
Loop()
|
Method Summary |
void |
execute_void(Chromosome c,
int n)
Executes this node, returning nothing. |
Type |
getChildType(int n)
Gets the type of node allowed form the given child number. |
java.lang.String |
getName()
Gets the name of this node. |
Methods inherited from class com.groovyj.jgprog.Function |
execute_boolean, execute_double, execute_float, execute_int, execute_long, execute_object, execute, getArity, getReturnType, setIndividual, setReturnType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Loop
public Loop()
getName
public java.lang.String getName()
- Description copied from class:
Function
- Gets the name of this node. Must be overridden in subclasses.
- Overrides:
getName
in class Function
- Following copied from class:
com.groovyj.jgprog.Function
- Returns:
- the name of this node.
getChildType
public Type getChildType(int n)
- Description copied from class:
Function
- Gets the type of node allowed form the given child number. Must be overridden
in subclasses.
- Overrides:
getChildType
in class Function
- Following copied from class:
com.groovyj.jgprog.Function
- Parameters:
i
- the child number- Returns:
- the type of node allowed for that child
execute_void
public void execute_void(Chromosome c,
int n)
- Description copied from class:
Function
- Executes this node, returning nothing.
- Overrides:
execute_void
in class Function
- Following copied from class:
com.groovyj.jgprog.Function
- Throws:
UnsupportedOperationException
- if the type of this node is not void