|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--condor.classad.Context
A context for evaluating ClassAd expressions. It consists of a pointer to the outermost classad of the ``top-level'' expression being evaluated and two hash tables.
The first table maps subexpressions to the results of evaluating them. It serves not only to ``memoize'' computed results as a shortcut to speed up evaluation but also (perhaps more importantly) to detect circular references.
The second table maps classad expressions to their parent scopes. The parent scope of a classad is normally the classad that immediately encloses statically, but may be any classad expression in special cases. In particular, this flexibility is used by ClassAd.bind to create a Context in which each of two RecordExprs is the parent of the other.
Eventually, other transient state may be added to this class to allow iteration through a set of results, etc.
ClassAd.bind(condor.classad.RecordExpr,
condor.classad.RecordExpr)| Field Summary | |
RecordExpr |
root
The outermost classad of the expression being evaluated. |
| Constructor Summary | |
Context(RecordExpr root)
Create a new context. |
|
| Method Summary | |
RecordExpr |
getParent(RecordExpr expr)
Look for a cached parent binding. |
Expr |
getValue(Expr expr)
Look for a cached evaluation. |
Context |
setParent(RecordExpr expr,
RecordExpr value)
Record the parent RecordExpr of a given node |
Context |
setValue(Expr expr,
Expr value)
Record the computed value of a given node. |
String |
toString()
Convert this Context to a string, for debugging purposes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public final RecordExpr root
| Constructor Detail |
public Context(RecordExpr root)
root - the outermost classad in the expression being evaluated.| Method Detail |
public Expr getValue(Expr expr)
expr - the Expr node.
public Context setValue(Expr expr,
Expr value)
expr - the given Expr node.value - the corresponding value.public RecordExpr getParent(RecordExpr expr)
expr - a RecordExpr node.
public Context setParent(RecordExpr expr,
RecordExpr value)
expr - the given RecordExpr node.value - the enclosing RecordExpr.public String toString()
toString in class Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||