public abstract class Expression extends Named
Modifier and Type | Field and Description |
---|---|
protected static ModelFactory |
factory
The singleton ModelFactory for creating objects of different model
types.
|
protected java.lang.String |
type
The type of this Expression.
|
Modifier | Constructor and Description |
---|---|
protected |
Expression()
Creates a default Expression.
|
protected |
Expression(java.lang.String name)
Creates an Expression with a name.
|
protected |
Expression(java.lang.String name,
java.lang.String type)
Creates an Expression with a name and a type.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
assign(java.lang.Object value)
Assigns a value to this Expression.
|
boolean |
equals(java.lang.Object other)
Reports whether this Expression is equal to another object.
|
abstract java.lang.Object |
evaluate()
Evaluates this Expression.
|
java.lang.String |
getName()
Returns the name of an Expression.
|
java.lang.String |
getType()
Returns the type of this Expression.
|
int |
hashCode()
Returns a quasi-unique hash code for this expression.
|
abstract boolean |
isAssignable()
Reports whether this Expression is re-assignable.
|
boolean |
isBottom()
Reports whether this Expression is the bottom element of its type.
|
abstract boolean |
isBound()
Reports whether this Expression is bound.
|
boolean |
isOrdered()
Reports whether this Expression has a strictly ordered type.
|
abstract void |
rebind()
Rebinds this Expression.
|
abstract void |
rebind(java.lang.Object result)
Rebinds this unbound Expression to the given result.
|
abstract Expression |
resolve(Scope scope)
Causes this Expression to resolve its embedded global and local
Parameter references.
|
Expression |
setType(java.lang.String type)
Sets the type of this expression.
|
abstract void |
unbind()
Unbinds this Expression.
|
safeEquals, safeHashCode, semanticError
protected static ModelFactory factory
protected java.lang.String type
protected Expression()
protected Expression(java.lang.String name)
name
- the name of this Expression.protected Expression(java.lang.String name, java.lang.String type)
name
- the name of this expression.type
- the type of this expression.public boolean equals(java.lang.Object other)
public int hashCode()
public java.lang.String getName()
public Expression setType(java.lang.String type)
type
- the type to set.public java.lang.String getType()
public abstract boolean isAssignable()
public boolean isOrdered()
public boolean isBottom()
public abstract void assign(java.lang.Object value)
value
- the value to assign.public abstract java.lang.Object evaluate()
public abstract boolean isBound()
public abstract void unbind()
public abstract void rebind()
public abstract void rebind(java.lang.Object result)
result
- the desired bound value.public abstract Expression resolve(Scope scope)
scope
- a table of global and local Parameters.