com.groovyj.jgprog.functions
Class Not

java.lang.Object
  |
  +--com.groovyj.jgprog.Function
        |
        +--com.groovyj.jgprog.functions.Not
All Implemented Interfaces:
java.io.Serializable

public class Not
extends Function
implements java.io.Serializable

The logical-not function. Allowed to be of type boolean. Its one child must be of type boolean.

Copyright (c) 2000 Robert Baruch. This code is released under the GNU General Public License (GPL).

Version:
$Id: Not.java,v 1.1 2000/10/12 15:19:39 groovyjava Exp $
Author:
Robert Baruch (jgprog@sourceforge.net)
See Also:
Serialized Form

Fields inherited from class com.groovyj.jgprog.Function
arity, individual, returnType
 
Constructor Summary
Not()
          Creates a logical-not node
 
Method Summary
 boolean execute_boolean(Chromosome c, int n)
          Executes this node as a boolean.
 Type getChildType(int i)
          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_double, execute_float, execute_int, execute_long, execute_object, 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
 

Constructor Detail

Not

public Not()
Creates a logical-not node
Since:
1.0
Method Detail

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.

execute_boolean

public boolean execute_boolean(Chromosome c,
                               int n)
Description copied from class: Function
Executes this node as a boolean.
Overrides:
execute_boolean in class Function
Following copied from class: com.groovyj.jgprog.Function
Returns:
the boolean return value of this node
Throws:
UnsupportedOperationException - if the type of this node is not boolean

getChildType

public Type getChildType(int i)
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