|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object condor.classad.Expr condor.classad.RecordExpr
A "record" expression (also known as a "classad"). An internal (non-leaf) node of an expression tree representing a classified ad (a.k.a. property list, record, table, map, etc.) A record is logically a mapping from case-independent strings (AttrNames) to expressions (Exprs). It keeps track of the original strings (with case preserved) and the order in which they were added so that the "original" record can be printed.
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, 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 | |
RecordExpr()
Default constructor: a record with no fields. |
|
RecordExpr(int n)
Creates a RecordExpr with a specified capacity. |
Method Summary | |
Iterator |
attributes()
Enumerate the attribute names. |
protected Expr |
eval1(Expr.Env env)
Evaluate this Expr. |
RecordExpr |
insertAttribute(AttrName key,
Expr expr)
Add an attribute (replacing previous value if any). |
RecordExpr |
insertAttribute(String name,
Expr expr)
Add an attribute (replacing previous value if any). |
Expr |
lookup(AttrName name)
Find the attribute with the given name. |
Expr |
lookup(AttrName name,
Expr.Env env)
Find the attribute with the given name in this RecordExpr or one of its ancestors. |
Expr |
lookup(String name)
Find the attribute with the given name in this RecordExpr. |
int |
prec()
The precedence of the operator in this expression node. |
Expr |
removeAttribute(AttrName attr)
Delete an attribute. |
int |
size()
Count how many attributes. |
StringBuffer |
toString(StringBuffer sb)
Convert this Expr to a string, appending the result to the end of "sb". |
void |
transmit(DataOutput out)
Serialize this RecordExpr in the format currently expected by Condor. |
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 |
Constructor Detail |
public RecordExpr()
public RecordExpr(int n)
n
- the estimated number of attributes to be inserted into
this RecordExpr (for efficiency only).Method Detail |
protected String typeName()
typeName
in class Expr
public Expr lookup(String name)
name
- the attribute name to look for.
public Expr lookup(AttrName name, Expr.Env env)
name
- the attribute nae to look for.env
- the environment to search and update if this RecordExpr does
not directly defined "name".
public Expr lookup(AttrName name)
name
- the attribute name to look for.
public RecordExpr insertAttribute(String name, Expr expr)
name
- the name of the attribute to be added.expr
- the value of the attribute.
IllegalArgumentException
- if name or expr is null.public RecordExpr insertAttribute(AttrName key, Expr expr)
key
- the name of the attribute to be added.expr
- the value of the attribute.
IllegalArgumentException
- if name or expr is null or name is a
reserved word.public Expr removeAttribute(AttrName attr)
attr
is removed from
this RecordExpr.
attr
- the attribute to be removed.
public int size()
public Iterator attributes()
protected Expr eval1(Expr.Env env)
Expr.eval()
.
A Record evaluates to itself.
eval1
in class Expr
env
- ignored.
public StringBuffer toString(StringBuffer sb)
'[' [ name '=' expr [ ';' name '=' expr ]* ] ']'
with no
extra spaces.
Each "name" is represented as by AttrRef.toString()
.
toString
in class Expr
sb
- a place to put the result.
ClassAdWriter
public void transmit(DataOutput out) throws IOException
To reconstitute a classad from this format, use a ClassAdReader
and a ClassAdParser
.
out
- the stream to which the serialzed data should be written.
InvalidObjectException
- if this add does not have MyType and
TargetType attributes.
IOException
- if an I/O error occurs.ClassAdParser.parse()
,
ClassAdReader
public int prec()
prec
in class Expr
ClassAdWriter.MINIMAL_PARENTHESES
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |