uk.ac.man.cs.rainbow.rapa.data
Class AbstractType

java.lang.Object
  |
  +--uk.ac.man.cs.rainbow.rapa.data.AbstractType
All Implemented Interfaces:
Argument, Serializable, Type

public class AbstractType
extends Object
implements Type, Serializable

See Also:
Serialized Form

Field Summary
static String TOPSTRING
          Standard string representation of top values.
 
Constructor Summary
AbstractType(String name, String[] values)
          Create a new abstract type, adding a top value.
AbstractType(String name, String[] values, boolean addTop)
          Create a new abstract type.
 
Method Summary
 void compatableWith(Argument arg)
           
 boolean equals(Object o)
           
 Value getTop()
          Get the top value for the type.
 Value getValue(int i)
          Retrieve the ith value.
 Value getValue(String name)
          Retrieve the value called name.
 String getValueName(int i)
          Retrieve the name of the ith value.
 int numValues()
          How many values are there in this type?
 Type subst(GeneralSubstitution s)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TOPSTRING

public static final String TOPSTRING
Standard string representation of top values.
Constructor Detail

AbstractType

public AbstractType(String name,
                    String[] values)
Create a new abstract type, adding a top value.
Parameters:
name - The name of the type.
values - Array of identifiers for values of the type.

AbstractType

public AbstractType(String name,
                    String[] values,
                    boolean addTop)
Create a new abstract type.
Parameters:
name - The name of the type.
values - Array of identifiers for values of the type.
addTop - Whether to add a top value to the type.
Method Detail

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

toString

public String toString()
Overrides:
toString in class Object

numValues

public int numValues()
How many values are there in this type?

getValue

public Value getValue(int i)
Retrieve the ith value.

getValue

public Value getValue(String name)
Retrieve the value called name.

getValueName

public String getValueName(int i)
Retrieve the name of the ith value.

getTop

public Value getTop()
Get the top value for the type.

equals

public boolean equals(Object o)
Overrides:
equals in class Object