condor.classad
Class ListExpr

Object
  |
  +--condor.classad.Expr
        |
        +--condor.classad.ListExpr

public class ListExpr
extends Expr

A list of expressions. An internal (non-leaf) node of an expression tree representing the list-construction operator { expr, expr, ... }.

Version:
2.0
Author:
Marvin Solomon
See Also:
Expr

Nested Class Summary
 
Nested classes inherited from class condor.classad.Expr
Expr.Env
 
Field Summary
 
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
ListExpr()
          Construct an empty list.
ListExpr(List l)
          Construct a list from a list of expressions.
 
Method Summary
 Expr add(Expr e)
          Appends the specified Expr to the end of this list.
protected  Expr eval1(Expr.Env env)
          Evaluate this Expr.
 Iterator iterator()
          Get an iterator for iterating throught the members of this list.
 int prec()
          The precedence of the operator in this expression node.
 int size()
          Get the length of this list.
 Expr sub(int i)
          Get a member of this list.
 StringBuffer toString(StringBuffer sb)
          Convert this Expr to a string, appending the result to the end of "sb".
protected  String typeName()
          Get 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
 

Constructor Detail

ListExpr

public ListExpr()
Construct an empty list.


ListExpr

public ListExpr(List l)
Construct a list from a list of expressions.

Method Detail

size

public int size()
Get the length of this list.

Returns:
the number of elements in this list

sub

public Expr sub(int i)
Get a member of this list.

Parameters:
i - the member to be retrieved.
Returns:
the ith member of this list, or an error Constant if i is out of bounds.

add

public Expr add(Expr e)
Appends the specified Expr to the end of this list.

Parameters:
e - the Expr to add.
Returns:
this ListExpr.

iterator

public Iterator iterator()
Get an iterator for iterating throught the members of this list.

Returns:
an iterator for enumerating the Expr members of this list.

typeName

protected String typeName()
Get the type of the expression.

Overrides:
typeName in class Expr
Returns:
the string "list".

eval1

protected Expr eval1(Expr.Env env)
Evaluate this Expr. This is the internal method used to implement Expr.eval(). A List evaluates to itself.

Specified by:
eval1 in class Expr
Parameters:
env - ignored.
Returns:
this ListExpr.

toString

public StringBuffer toString(StringBuffer sb)
Convert this Expr to a string, appending the result to the end of "sb". The representation is the "canonical native format".

Specified by:
toString in class Expr
Parameters:
sb - a place to put the result.
Returns:
sb.
See Also:
ClassAdWriter

prec

public int prec()
The precedence of the operator in this expression node. Used to print expressions without superfluous parentheses.

Specified by:
prec in class Expr
Returns:
the precendence of this node.
See Also:
ClassAdWriter.MINIMAL_PARENTHESES