condor.classad
Class SelectExpr
java.lang.Object
|
+--condor.classad.Expr
|
+--condor.classad.SelectExpr
- public class SelectExpr
- extends Expr
An internal (non-leaf) node of an expression tree, representing a selection
of component of a record. It has the form from a class ad in the form
<expr> . <identifier>.
- Version:
- 1.2
- Author:
- Marvin Solomon
- See Also:
Expr
Fields inherited from class condor.classad.Expr |
ABSOLUTE_TIME, AND, ATTRIBUTE, BIT_COMPLEMENT, BITAND, BITOR, BITXOR, BOOLEAN, BRIEF, CALL, COMPACT, COND, dblevel, DIFFERENT, DIV, EQUAL, ERROR, formatFlags, formatIndent, GREATER, GREATER_EQ, INTEGER, LEFT_SHIFT, LESS, LESS_EQ, LIST, MAXPREC, MINIMAL_PARENTHESES, MINUS, MOD, MULTI_LINE_ADS, MULTI_LINE_LISTS, NO_ESCAPE_STRINGS, NOT, NOT_EQUAL, OP, opName, OR, PLUS, READABLE, REAL, RECORD, RELATIVE_TIME, RIGHT_SHIFT, SAME, SELECTION, SHOW_ERROR_DETAIL, SHOW_INSTANCES, STRING, SUBSCRIPT, TIMES, type, UMINUS, UNDEFINED, UPLUS, URIGHT_SHIFT |
Constructor Summary |
SelectExpr(Expr base,
condor.classad.CiString selector)
Create a new SelectExpr corresponding to base.selector . |
SelectExpr(Expr base,
String selector)
Create a new SelectExpr corresponding to base.selector . |
Method Summary |
protected int |
prec()
The precedence of the operator in this expression node. |
protected Expr |
reEval(Context ctx)
Evalutate this expression. |
static Expr |
select(Expr base,
String[] sel)
A convenience function for creating a SelectExpression corresponding
to "base.a.b.c" |
String |
toString()
Convert this Expr to a string. |
protected String |
typeName()
The type of the expression. |
Methods inherited from class condor.classad.Expr |
db, db, disableFormatFlags, enableFormatFlags, eval, getFormatFlags, isConstant, isNormalForm, mark, mark, mark, select, setFormatFlags, toString |
SelectExpr
public SelectExpr(Expr base,
String selector)
- Create a new SelectExpr corresponding to
base.selector
.
- Parameters:
base
- the left argument (base expression).selector
- the right argument (identifier).
SelectExpr
public SelectExpr(Expr base,
condor.classad.CiString selector)
- Create a new SelectExpr corresponding to
base.selector
.
- Parameters:
base
- the left argument (base expression).selector
- the right argument (identifier).
select
public static Expr select(Expr base,
String[] sel)
- A convenience function for creating a SelectExpression corresponding
to "base.a.b.c"
- Parameters:
base
- the base Expr.sel
- the sequence of selectors {"a", "b", "c"}
- Returns:
- a new SelectExpr or
base
if sel
is
empty.
typeName
protected String typeName()
- The type of the expression. This should never be called!
- Overrides:
typeName
in class Expr
- Returns:
- the string "selection".
toString
public String toString()
- Convert this Expr to a string.
The exact format of the result is controled by the static fields
Expr.formatFlags
and Expr.formatIndent
.
The result may be multiple lines long (it may include embedded newlines
and tabs), but it never ends with a newline.
- Overrides:
toString
in class Expr
- Returns:
- a string representation of the this Context
- See Also:
Expr.formatFlags
,
Expr.formatIndent
prec
protected int prec()
- The precedence of the operator in this expression node.
Used to print expressions without superfluous parentheses.
- Overrides:
prec
in class Expr
- Returns:
- the precendence of this node.
- See Also:
Expr.MINIMAL_PARENTHESES
reEval
protected Expr reEval(Context ctx)
- Evalutate this expression.
- Overrides:
reEval
in class Expr
- Parameters:
ctx
- an evaluation context for evaluating this expression- Returns:
- a Constant, ListExpr, or RecordExpr representing the value.
- See Also:
Expr.eval(condor.classad.Context)