Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.core
Class GenotypeID

java.lang.Object
  extended byorg.evolvica.core.GenotypeID
All Implemented Interfaces:
IDatatype

public class GenotypeID
extends java.lang.Object
implements IDatatype

Default implementation of a genotype ID. This class is not intended to be subclassed.

Since:
0.4.0
Version:
$Revision: 1.6 $ $Date: 2004/05/26 11:57:52 $
Author:
Andreas Rummler

Nested Class Summary
 
Nested classes inherited from class org.evolvica.engine.IDatatype
IDatatype.UniversalDatatype
 
Field Summary
protected  java.lang.Class clazz
          The referenced genotype class.
 
Fields inherited from interface org.evolvica.engine.IDatatype
UNIVERSAL
 
Constructor Summary
GenotypeID(java.lang.Class clazz)
          Constructor.
 
Method Summary
 java.lang.String getName()
          Return the name of this identifier.
 java.lang.Class getReferencedClass()
          Returns the class of the referenced datatype.
 boolean isCompatibleTo(IDatatype otherDatatype)
          Checks if this datatype is compatible to another datatype.
 boolean isEqualTo(IDatatype otherDatatype)
          Checks if this ID equals the given (other) ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clazz

protected java.lang.Class clazz
The referenced genotype class.

Constructor Detail

GenotypeID

public GenotypeID(java.lang.Class clazz)
Constructor.

Parameters:
clazz - genotype class
Method Detail

getName

public java.lang.String getName()
Description copied from interface: IDatatype
Return the name of this identifier.

Specified by:
getName in interface IDatatype
Returns:
name of this identifier
See Also:
IDatatype.getName()

getReferencedClass

public java.lang.Class getReferencedClass()
Description copied from interface: IDatatype
Returns the class of the referenced datatype.

Specified by:
getReferencedClass in interface IDatatype
Returns:
class of the referenced datatype
See Also:
IDatatype.getReferencedClass()

isEqualTo

public boolean isEqualTo(IDatatype otherDatatype)
Description copied from interface: IDatatype
Checks if this ID equals the given (other) ID.

Specified by:
isEqualTo in interface IDatatype
Parameters:
otherDatatype - data type to check
Returns:
true if both IDs equal, false instead
See Also:
IDatatype.isEqualTo(org.evolvica.engine.IDatatype)

isCompatibleTo

public boolean isCompatibleTo(IDatatype otherDatatype)
Description copied from interface: IDatatype
Checks if this datatype is compatible to another datatype. This datatype is compatible if the referenced class is a subclass of the referenced class of the other datatype. Example: Given are the two classes:
 public class DefaultInteger { ... }
 public class ExtendedInteger extends DefaultInteger { ... }
 
Calls to the isCompatibleTo()-methods:
 DefaultInteger integer = new DefaultInteger();
 ExtendedInteger extInteger = new ExtendedInteger();
 System.out.println( integer.getType().isCompatibleTo( extInteger.getType() ) );
 System.out.println( extInteger.getType().isCompatibleTo( integer.getType() ) );
 
return the following results:
 false
 true
 
That means an ExtendedInteger can be used as a DefaultInteger but the opposite case (using a DefaultInteger as an ExtendedInteger) is not possible.

Specified by:
isCompatibleTo in interface IDatatype
Parameters:
otherDatatype - data type to check
Returns:
true if this datatype is compatible to the other datatype, false instead
See Also:
IDatatype.isCompatibleTo(org.evolvica.engine.IDatatype)

Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

Copyright © 2000-2004 Technical University of Ilmenau, Department Electronic Circuits and Systems