All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gpsys.primitives.Zero

java.lang.Object
   |
   +----gpsys.Primitive
           |
           +----gpsys.Terminal
                   |
                   +----gpsys.primitives.Zero

public class Zero
extends Terminal
	<typeX> Zero
 
Zero is a generic Terminal which which represents the constant value zero. Zero needs to be instantiated to return values for a particular type. Valid types include BYTE, SHORT, INT, LONG, FLOAT and DOUBLE.

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, Terminal

Constructor Index

 o Zero(Type)
Constructs a constant of value zero for the specified type.

Method Index

 o evaluateByte(Individual)
Used to get a BYTE value of the constant zero.
 o evaluateDouble(Individual)
Used to get a DOUBLE value of the constant zero.
 o evaluateFloat(Individual)
Used to get a FLOAT value of the constant zero.
 o evaluateInt(Individual)
Used to get a INT value of the constant zero.
 o evaluateLong(Individual)
Used to get a LONG value of the constant zero.
 o evaluateShort(Individual)
Used to get a SHORT value of the constant zero.
 o instance()
Creates an instance of this Zero object.
 o toString()
Returns a String representation of this Terminal.

Constructors

 o Zero
 public Zero(Type type)
Constructs a constant of value zero for the specified type.

Parameters:
type - The required type of the Zero's value.

Methods

 o evaluateByte
 public final byte evaluateByte(Individual i) throws EvaluationException
Used to get a BYTE value of the constant zero.

Parameters:
i - The individual being evaluated.
Returns:
A byte representing the value of the constant zero.
Throws: EvaluationException
If there is an evaluation failure.
Overrides:
evaluateByte in class Terminal
 o evaluateShort
 public final short evaluateShort(Individual i) throws EvaluationException
Used to get a SHORT value of the constant zero.

Parameters:
i - The individual being evaluated.
Returns:
A short representing the value of the constant zero.
Throws: EvaluationException
If there is an evaluation failure.
Overrides:
evaluateShort in class Terminal
 o evaluateInt
 public final int evaluateInt(Individual i) throws EvaluationException
Used to get a INT value of the constant zero.

Parameters:
i - The individual being evaluated.
Returns:
An int representing the value of the constant zero.
Throws: EvaluationException
If there is an evaluation failure.
Overrides:
evaluateInt in class Terminal
 o evaluateLong
 public final long evaluateLong(Individual i) throws EvaluationException
Used to get a LONG value of the constant zero.

Parameters:
i - The individual being evaluated.
Returns:
A long representing the value of the constant zero.
Throws: EvaluationException
If there is an evaluation failure.
Overrides:
evaluateLong in class Terminal
 o evaluateFloat
 public final float evaluateFloat(Individual i) throws EvaluationException
Used to get a FLOAT value of the constant zero.

Parameters:
i - The individual being evaluated.
Returns:
A float representing the value of the constant zero.
Throws: EvaluationException
If there is an evaluation failure.
Overrides:
evaluateFloat in class Terminal
 o evaluateDouble
 public final double evaluateDouble(Individual i) throws EvaluationException
Used to get a DOUBLE value of the constant zero.

Parameters:
i - The individual being evaluated.
Returns:
A double representing the value of the constant zero.
Throws: EvaluationException
If there is an evaluation failure.
Overrides:
evaluateDouble in class Terminal
 o instance
 public final Primitive instance()
Creates an instance of this Zero object. The Type instantiation is preserved so that if an INT Zero 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
 o toString
 public String toString()
Returns a String representation of this Terminal.

Returns:
A String containing the name of the Terminal.
Overrides:
toString in class Primitive

All Packages  Class Hierarchy  This Package  Previous  Next  Index