|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--condor.classad.Expr | +--condor.classad.SubscriptExpr
A selection from a list.
An internal (non-leaf) node of an expression tree representing a subscript
applied to base expression: base[selector]
. Two
combinations of types are possible: Either the base is a ListExpr and
the selector evaluates to an integer, or the base is a RecordExpr and the
subscript evaluates to a string. In the latter case, base["x"]
is equivalent to base.x
except that the "selector" does not
have to be a literal string.
Expr
Nested Class Summary |
Nested classes inherited from class condor.classad.Expr |
Expr.Env |
Field Summary | |
Expr |
base
The left argument (base expression) of the subscript operator. |
Expr |
selector
The right argument (subscript) of the selection operator. |
Fields inherited from class condor.classad.Expr |
ABSOLUTE_TIME, AND, ATTRIBUTE, BIT_COMPLEMENT, BITAND, BITOR, BITXOR, BOOLEAN, CALL, COND, dateAndTimeFormat, dateFormat, dblevel, DIFFERENT, DIV, EQUAL, ERROR, GREATER, GREATER_EQ, INTEGER, LEFT_SHIFT, LESS, LESS_EQ, LIST, MAXPREC, MINUS, MOD, NOT, NOT_EQUAL, OP, opName, opNameXML, OR, PLUS, REAL, RECORD, RELATIVE_TIME, RIGHT_SHIFT, SAME, SELECTION, STRING, SUBSCRIPT, TIMES, type, UMINUS, UNDEFINED, UPLUS, URIGHT_SHIFT |
Constructor Summary | |
SubscriptExpr(Expr base,
Expr selector)
Create a new SubscriptExpr. |
Method Summary | |
protected Expr |
eval1(Expr.Env env)
Evaluate this Expr. |
int |
prec()
The precedence of the operator in this expression node. |
StringBuffer |
toString(StringBuffer sb)
Convert this Expr to a string, appending the result to the end of "sb". |
protected String |
typeName()
The type of the expression. |
Methods inherited from class condor.classad.Expr |
db, db, eval, eval, intValue, isConstant, isTrue, realValue, selectExpr, stringValue, subExpr, toString |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public final Expr base
public final Expr selector
Constructor Detail |
public SubscriptExpr(Expr base, Expr selector)
base
- the left argument (base expression).selector
- the right argument (subscript).Method Detail |
protected String typeName()
typeName
in class Expr
public StringBuffer toString(StringBuffer sb)
toString
in class Expr
sb
- a place to put the result.
ClassAdWriter
public int prec()
prec
in class Expr
ClassAdWriter.MINIMAL_PARENTHESES
protected Expr eval1(Expr.Env env)
Expr.eval()
.
The base and selector should evaluate to a List and an integer or
a Record and a string. In the latter case, this SubscriptExpr is
semantically equivalent to a SelectExpr. In either case, the
appropriate component of the base value is then returned. If the types
of the base and selector do not mactch, the result is the ERROR
constant.
eval1
in class Expr
env
- an environment used to evaluate the base and selector;
it is updated to the resulting environment from the
evaluation of the base.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |