|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectVariable
Variables can be constrained with a list of possible values. Different Variables can have the same name (a Symbol).
Field Summary | |
(package private) Symbol |
name
The name of this Variable. |
(package private) VariableValueSet |
values
The possible values of this Variable (if any, otherwise unconstrained). |
Constructor Summary | |
Variable(Symbol name)
Create an unconstrained Variable with given name. |
|
Variable(Symbol name,
VariableValueSet values)
Create a new Variable with then given name and value restriction. |
Method Summary | |
Unifiable |
copyWithBindings(BindingSet bindings)
Returns a new Variable which is a copy of this one with the given bindings applied. |
java.util.Set |
getValues()
Returns the Set of possible values for this Variable. |
(package private) boolean |
occursIn(Expression expr)
Returns true if this Variable occurs in the given Expression. |
java.lang.String |
toString()
Returns the printable representation of this Variable as a String. |
boolean |
unifyWith(Unifiable other,
BindingSet bindings)
Try to unify this Variable with another Unifiable. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
Symbol name
VariableValueSet values
Constructor Detail |
public Variable(Symbol name)
public Variable(Symbol name, VariableValueSet values)
Method Detail |
public java.util.Set getValues()
public java.lang.String toString()
public boolean unifyWith(Unifiable other, BindingSet bindings)
unifyWith
in interface Unifiable
boolean occursIn(Expression expr)
public Unifiable copyWithBindings(BindingSet bindings)
copyWithBindings
in interface Unifiable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |