|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.man.cs.rainbow.rapa.data.Expression | +--uk.ac.man.cs.rainbow.datamodel.Data
The core class of data values. The major specialisations are nested top-level classes for convenience of writing.
Of interest are:
Data.Word
- word (enumerable) values.
Data.List
- list (structured/compound) values.
Data.Union
- union (tagged/discriminated) values.
Data.Untyped
- superclass of untypable values.
Type
, Serialized FormInner Class Summary | |
static interface |
Data.Comparable
Indicate that two data values can be compared for relative order. |
static class |
Data.List
Compound "list" datatypes. |
static class |
Data.Union
Union datatypes. |
static class |
Data.Untyped
The superclass of all Untypeable data classes. |
static class |
Data.Word
Basic "word" datatypes. |
Method Summary | |
Value |
apply(Unifier u)
Apply a unifier to this value to get a new value. |
abstract Data |
cast(Type t)
Return a new data value that has the given type. |
abstract boolean |
equals(Data d)
Standardised equality defined over data values with equal types. |
boolean |
equals(Object o)
|
boolean |
equals(Value o)
Standard equality lifted to handle any argument object including data objects with non-equal types. |
Type |
getResultType()
|
Type |
getType()
Get the type of the data value. |
int |
hashCode()
Hash-code generator. |
boolean |
hasVariable()
|
static void |
main(String[] args)
Test code... |
boolean |
occurs(Substitution s,
Variable v)
Check whether the variable occurs in this value under the given substitution. |
static Data |
parse(String s)
Attempts to parse the given string to produce a data value. |
static Data |
parse(String s,
Hashtable context)
Attempts to parse the given string (in context) to produce a data value. |
Value |
subst(Substitution s)
Apply a substitution to this value to get a new value. |
abstract String |
toString()
Print the data value. |
String |
typedString()
Print the data value with a type annotation. |
Substitution |
unify(Substitution s,
Value val)
Get the substitution which unifies this value with the given value, after applying the given substitution. |
Methods inherited from class uk.ac.man.cs.rainbow.rapa.data.Expression |
compatableWith, evaluate, getNodeType, subst |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
public abstract String toString()
toString
in class Object
public Type getType()
public String typedString()
public abstract Data cast(Type t) throws TypeException
TypeException
- Thrown if the data value being cast from (or some part of it)
disgrees with the type (or type component) that is being
specified for it.public abstract boolean equals(Data d)
public boolean equals(Value o)
equals
in class Expression
public boolean equals(Object o)
equals
in class Expression
public int hashCode()
hashCode
in class Object
public static Data parse(String s) throws TypeException
public static Data parse(String s, Hashtable context) throws TypeException
public boolean hasVariable()
public Value apply(Unifier u)
Value
apply
in class Expression
public Value subst(Substitution s)
Value
subst
in class Expression
public boolean occurs(Substitution s, Variable v)
Value
occurs
in class Expression
public Substitution unify(Substitution s, Value val) throws NotUnifiable
Value
unify
in class Expression
uk.ac.man.cs.rainbow.rapa.data.Value
subst
- The substitution to apply first.val
- The value to unify with this value.NotUnifiable
- If the two values cannot be unified.public Type getResultType()
getResultType
in class Expression
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |