|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object condor.classad.ClassAd
A library of handy methods for manipulating classad expressions.
The class contains only static methods for performing various operations on
classified advertisements. See Expr
and its various subclasses,
especially RecordExpr
for the actual objects that are manipulated.
Expr
,
RecordExpr
Method Summary | |
static RecordExpr |
bind(RecordExpr ad1,
RecordExpr ad2)
Wrap a pair of ads in an environment and context such that inside ad1, self refers to ad1 , other
refers to ad2 , and any other attribute is searched for
first in ad1 and then in ad2 (and similarly,
with ad1 and ad2 interchanged). |
static Constant |
constant(double x)
Create a constant expression from a real value. |
static Constant |
constant(int i)
Create a constant expression from an integer value. |
static Constant |
constant(String s)
Create a constant expression from a String value. |
static Expr |
eval(RecordExpr ad,
String attr)
Evaluate a selection from a ClassAd. |
static Expr |
eval(RecordExpr ad,
String[] attrs)
Evaluate a selection from a ClassAd. |
static Expr |
eval(String name,
Expr expr,
RecordExpr ad)
Evaluate an expression in the context of a ClassAd. |
static Expr |
eval(String attr,
RecordExpr ad1,
RecordExpr ad2)
Evaluate an attribute of a ClassAd in an environment consisting of a pair of ads. |
static boolean |
loadJavaLibrary(String className)
Loads a library of externally defined Java functions. |
static int[] |
match(Expr expr1,
Expr expr2)
Match two ClassAds. |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static RecordExpr bind(RecordExpr ad1, RecordExpr ad2)
self
refers to ad1
, other
refers to ad2
, and any other attribute is searched for
first in ad1
and then in ad2
(and similarly,
with ad1
and ad2
interchanged).
ad1
- the first ClassAd.ad2
- the second ClassAd.
RecordExpr E
such that
E.Ad1.self
is ad1
, and
E.Ad2.self
is ad2
.public static Expr eval(RecordExpr ad, String[] attrs)
ad
- a ClassAd from which to select.attrs
- a sequence attr1, attr2, ..., attrn
of
attribute names.
ad.attr1.attr2...attrn
.public static Expr eval(RecordExpr ad, String attr)
ad
- a ClassAd from which to select.attr
- an attribute name.
ad.attr
.public static Expr eval(String name, Expr expr, RecordExpr ad)
expr
is evaluated as if it were a the value of an
attribute named name
in ad
.
Note: the RecordExpr ad
is modified and then
returned to its original state, so this method is not thread-safe.
name
- the name of the attribute.expr
- the expression to evaluate.ad
- the context for evaluation.
expr
in the context of
ad
.public static Expr eval(String attr, RecordExpr ad1, RecordExpr ad2)
ClassAd.eval(attr, ad1, ad2)
evaluates ad1.attr
an environment such that inside
ad1, self
refers to ad1
, other
refers to ad2
, and any other attribute is searched for
first in ad1
and then in ad2
(and similarly,
with ad1
and ad2
interchanged).
attr
- the name of the attribute used to initiate the evaluationad1
- the ClassAd used to initiate the evaluationad2
- the other ClassAd
public static int[] match(Expr expr1, Expr expr2)
Requirements
attribute that evaluates to true in the
context of the other expr and each expr has a Rank
attribute that evaluates to an integer, the result is two-element array
containing the Rank
values. In all other cases, the result
is null.
expr1
- the first expression.expr2
- the second expression.
public static boolean loadJavaLibrary(String className)
className
- the fully qualified name of the class (e.g.
condor.classad.Builtin)
public static Constant constant(int i)
i
- the value.
public static Constant constant(double x)
x
- the value.
public static Constant constant(String s)
s
- the value.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |