All Packages Class Hierarchy This Package Previous Next Index
Class gpsys.primitives.EQ
java.lang.Object
|
+----gpsys.Primitive
|
+----gpsys.Function
|
+----gpsys.primitives.EQ
- public class EQ
- extends Function
BOOLEAN EQ(<typeX> a, <typeX> b)
EQ is a generic function that tests the equality of its two arguments.
EQ needs to be Type instantiated during construction to work with particular
argument Types. The supported argument Types include BYTE, SHORT, INT, LONG,
FLOAT, DOUBLE, CHAR and BOOLEAN.
- Version:
- 1.1, 30th June '97
- Author:
- Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
- See Also:
- Type, Primitive, Function
-
EQ(Type)
- Constructs an EQ Function that works with the specified Type.
-
evaluateBoolean(Individual, Gene[])
- Used to test arguments of any of the supported Types for equality.
-
instance()
- Creates an instance of this EQ object.
-
toString()
- Returns a String representation of this Function.
EQ
public EQ(Type argTypes)
- Constructs an EQ Function that works with the specified Type. The
supported Types include BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, CHAR and
BOOLEAN.
- Parameters:
- type - The Type of this EQ Function.
evaluateBoolean
public final boolean evaluateBoolean(Individual i,
Gene arguments[]) throws EvaluationException
- Used to test arguments of any of the supported Types for equality.
- Parameters:
- i - The individual being evaluated.
- arguments - The Gene trees representing the arguments to be tested.
- Returns:
- A boolean whose value is true if they are equal and false
otherwise.
- Throws: EvaluationException
- If there is an evaluation failure.
- Overrides:
- evaluateBoolean in class Function
instance
public final Primitive instance()
- Creates an instance of this EQ object. The Type instantiation is
preserved so that if an INT EQ is being cloned, the clone will also be
INT instantiated.
- Returns:
- A reference to this Object (yes the same object, since
the type information is to be the same, there are therefore
no instance variables to be modified.
- Overrides:
- instance in class Primitive
toString
public String toString()
- Returns a String representation of this Function.
- Returns:
- A String containing the name of the Function.
- Overrides:
- toString in class Primitive
All Packages Class Hierarchy This Package Previous Next Index