gpsys
Class Type

java.lang.Object
  |
  +--gpsys.Type
Direct Known Subclasses:
LawnMowerTypes

public class Type
extends java.lang.Object
implements java.io.Serializable

Types are used to define return types of Primitives and Chromosomes. They are also used to define the argument types of Functions. A type has a string which defines the name of the type, name, and a unique integer which is used to identify the type (the typeID). This class has many predefined Types which are implemented as constants of this class. If a new type is required, make sure that a unique typeID is used. Note that to facilitate their use in java switch statements, Type constants for the predefined types also have their typeIDs duplicately defined as integer contants.

Version:
$Revision: 1.1 $, $Date: 2000/07/05 16:21:25 $
Author:
Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
See Also:
Primitive, Function, Chromosome, Serialized Form

Field Summary
static Type BOOLEAN
          The java boolean type.
static int BOOLEAN_typeID
          The type ID for java byte type.
static Type BYTE
          The java byte type.
static int BYTE_typeID
          The type ID for java byte type.
static Type CHAR
          The java char type.
static int CHAR_typeID
          The type ID for java byte type.
static Type DOUBLE
          The java double type.
static int DOUBLE_typeID
          The type ID for java byte type.
static Type FLOAT
          The java float type.
static int FLOAT_typeID
          The type ID for java byte type.
static Type INT
          The java int type.
static int INT_typeID
          The type ID for java byte type.
static Type LONG
          The java long type.
static int LONG_typeID
          The type ID for java byte type.
static Type MEM_BOOLEAN
          Indexed memory of java boolean type.
static int MEM_BOOLEAN_typeID
          The type ID for java byte type.
static Type MEM_BYTE
          Indexed memory of java byte type.
static int MEM_BYTE_typeID
          The type ID for java byte type.
static Type MEM_CHAR
          Indexed memory of java char type.
static int MEM_CHAR_typeID
          The type ID for java byte type.
static Type MEM_DOUBLE
          Indexed memory of java double type.
static int MEM_DOUBLE_typeID
          The type ID for java byte type.
static Type MEM_FLOAT
          Indexed memory of java float type.
static int MEM_FLOAT_typeID
          The type ID for java byte type.
static Type MEM_INT
          Indexed memory of java int type.
static int MEM_INT_typeID
          The type ID for java byte type.
static Type MEM_LONG
          Indexed memory of java long type.
static int MEM_LONG_typeID
          The type ID for java byte type.
static Type MEM_OBJECT
          Indexed memory of references to java Object types.
static int MEM_OBJECT_typeID
          The type ID for java byte type.
static Type MEM_SHORT
          Indexed memory of java short type.
static int MEM_SHORT_typeID
          The type ID for java byte type.
static Type OBJECT
          The a reference to the java Object type.
static int OBJECT_typeID
          The type ID for java byte type.
static Type SHORT
          The java short type.
static int SHORT_typeID
          The type ID for java byte type.
 int typeID
          The typeID uniquely identifies the Type.
 java.lang.String typeName
          The name given to the type.
 
Constructor Summary
Type()
          Default constructor, should never be used.
Type(int typeID, java.lang.String typeName)
          Construct a new type with the specified typeID and name.
 
Method Summary
 java.lang.String toString()
          Get a string representation of the type (the name of the type).
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

typeID

public int typeID
The typeID uniquely identifies the Type.

typeName

public java.lang.String typeName
The name given to the type.

BYTE

public static final Type BYTE
The java byte type.

BYTE_typeID

public static final int BYTE_typeID
The type ID for java byte type.

SHORT

public static final Type SHORT
The java short type.

SHORT_typeID

public static final int SHORT_typeID
The type ID for java byte type.

INT

public static final Type INT
The java int type.

INT_typeID

public static final int INT_typeID
The type ID for java byte type.

LONG

public static final Type LONG
The java long type.

LONG_typeID

public static final int LONG_typeID
The type ID for java byte type.

FLOAT

public static final Type FLOAT
The java float type.

FLOAT_typeID

public static final int FLOAT_typeID
The type ID for java byte type.

DOUBLE

public static final Type DOUBLE
The java double type.

DOUBLE_typeID

public static final int DOUBLE_typeID
The type ID for java byte type.

CHAR

public static final Type CHAR
The java char type.

CHAR_typeID

public static final int CHAR_typeID
The type ID for java byte type.

BOOLEAN

public static final Type BOOLEAN
The java boolean type.

BOOLEAN_typeID

public static final int BOOLEAN_typeID
The type ID for java byte type.

OBJECT

public static final Type OBJECT
The a reference to the java Object type.

OBJECT_typeID

public static final int OBJECT_typeID
The type ID for java byte type.

MEM_BYTE

public static final Type MEM_BYTE
Indexed memory of java byte type.

MEM_BYTE_typeID

public static final int MEM_BYTE_typeID
The type ID for java byte type.

MEM_SHORT

public static final Type MEM_SHORT
Indexed memory of java short type.

MEM_SHORT_typeID

public static final int MEM_SHORT_typeID
The type ID for java byte type.

MEM_INT

public static final Type MEM_INT
Indexed memory of java int type.

MEM_INT_typeID

public static final int MEM_INT_typeID
The type ID for java byte type.

MEM_LONG

public static final Type MEM_LONG
Indexed memory of java long type.

MEM_LONG_typeID

public static final int MEM_LONG_typeID
The type ID for java byte type.

MEM_FLOAT

public static final Type MEM_FLOAT
Indexed memory of java float type.

MEM_FLOAT_typeID

public static final int MEM_FLOAT_typeID
The type ID for java byte type.

MEM_DOUBLE

public static final Type MEM_DOUBLE
Indexed memory of java double type.

MEM_DOUBLE_typeID

public static final int MEM_DOUBLE_typeID
The type ID for java byte type.

MEM_CHAR

public static final Type MEM_CHAR
Indexed memory of java char type.

MEM_CHAR_typeID

public static final int MEM_CHAR_typeID
The type ID for java byte type.

MEM_BOOLEAN

public static final Type MEM_BOOLEAN
Indexed memory of java boolean type.

MEM_BOOLEAN_typeID

public static final int MEM_BOOLEAN_typeID
The type ID for java byte type.

MEM_OBJECT

public static final Type MEM_OBJECT
Indexed memory of references to java Object types.

MEM_OBJECT_typeID

public static final int MEM_OBJECT_typeID
The type ID for java byte type.
Constructor Detail

Type

public Type()
Default constructor, should never be used.

Type

public Type(int typeID,
            java.lang.String typeName)
Construct a new type with the specified typeID and name.
Parameters:
typeID - A unique integer indentifying the type.
typeName - Your name for the type.
Method Detail

toString

public java.lang.String toString()
Get a string representation of the type (the name of the type).
Returns:
The name of the type.
Overrides:
toString in class java.lang.Object