Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.engine
Class IDatatype.UniversalDatatype

java.lang.Object
  extended byorg.evolvica.engine.IDatatype.UniversalDatatype
All Implemented Interfaces:
IDatatype
Enclosing class:
IDatatype

public static final class IDatatype.UniversalDatatype
extends java.lang.Object
implements IDatatype

A universal datatype. This class cannot be instatiated, use IDatatype.UNIVERSAL to refer to this datatype.


Nested Class Summary
 
Nested classes inherited from class org.evolvica.engine.IDatatype
IDatatype.UniversalDatatype
 
Field Summary
 
Fields inherited from interface org.evolvica.engine.IDatatype
UNIVERSAL
 
Constructor Summary
IDatatype.UniversalDatatype()
          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
 

Constructor Detail

IDatatype.UniversalDatatype

public IDatatype.UniversalDatatype()
Constructor.

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