uk.ac.man.cs.rainbow.datamodel
Class Type

java.lang.Object
  |
  +--uk.ac.man.cs.rainbow.datamodel.Type
All Implemented Interfaces:
Argument, Serializable, Type
Direct Known Subclasses:
Type.Boolean, Type.Enum, Type.Integer, Type.Tuple, Type.Union, Type.Vector

public abstract class Type
extends Object
implements Serializable, Type

The core class of types. You can only instantiate the classes inside this one directly though, as raw types are not useful.

See Also:
Data, TypeData, Serialized Form

Inner Class Summary
static class Type.Boolean
          The class of types of booleans.
static class Type.Enum
          The class of types of enumerations.
static class Type.Integer
          The class of types of integers.
static class Type.Tuple
          The class of types of tuples/records/bundles.
static class Type.Union
          The class of types of unions.
static class Type.Vector
          The class of types of vectors.
 
Method Summary
 void compatableWith(Argument arg)
           
 boolean equals(Object o)
          General equality test for types.
abstract  boolean equals(Type t)
          Test for equality between types.
static Type parse(String s)
          Attempts to parse the given string to produce a type.
static Type parse(String s, Hashtable context)
          Attempts to parse the given string (in context) to produce a type.
 Type subst(GeneralSubstitution s)
           
abstract  String toString()
          Render the type as a string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public abstract String toString()
Render the type as a string. Must be specified by real types.
Overrides:
toString in class Object

equals

public final boolean equals(Object o)
General equality test for types. Defined in terms of the more specific version defined over types only, as a type is never equal to a non-type.
Overrides:
equals in class Object

equals

public abstract boolean equals(Type t)
Test for equality between types.

parse

public static Type parse(String s)
                  throws TypeException
Attempts to parse the given string to produce a type.

parse

public static Type parse(String s,
                         Hashtable context)
                  throws TypeException
Attempts to parse the given string (in context) to produce a type. The context is a mapping from identifiers to types. It may also contain mappings from other identifiers to data values.

compatableWith

public void compatableWith(Argument arg)
Specified by:
compatableWith in interface Argument
Following copied from interface: uk.ac.man.cs.rainbow.rapa.data.Argument
Throws:
CompatabilityFailure - If you are not allowed to map from this argument to the given one.

subst

public Type subst(GeneralSubstitution s)
Specified by:
subst in interface Type