Re: [classad-users] eval method


Date: Thu, 27 Jun 2002 13:37:47 -0500 (CDT)
From: Nicholas Coleman <ncoleman@xxxxxxxxxxx>
Subject: Re: [classad-users] eval method
If you want to test out function call expressions you should use the
following method:

public static Expr eval(RecordExpr ad, String[] attrs)

Where ad is the ClassAd that you have inserted and attrs is an array
containing the name of the attribute to be evaluated.

In your case you would call:

Expr e = eval( ad, {pippo} );

The reason that attrs is an array is that you might want to evaluate
attributes in nested classads.


If you want information about the parameters and return values of the
ClassAd functions in Java you should look at the source code for FuncCall
(FuncCall.java).  In case you don't have the source, here is an excerpt
containing all Java ClassAd functions (note that not all of the C++
functions are implemented in the java version,some have different
names, and some functions only exist in the Java version):

/* string operations */
"strcat",	// varags; apply string() to each arg first
"substr",	// substr(stringval,offset,length)
"strcmp",	// lex compare, return < = > 0
"stricmp",	// like strcmp, but convert to lower case first
"glob",	// "glob" style matching with * and ?
"iglob",	// like glob, but lower case in pattern matches either case

/* data conversion */
"int",	// convert arg to int (truc reals, parse strings)
"real",	// convert arg to real (parse strings)
"string",	// convert arg to string

/* real to int (first apply real() if necessary) */
"floor",	// greatest int <= value
"ceiling",	// smallest int >= value
"round",	// nearest int (IEEE rules)

/* time/date functions */
"unixTime",	// no args; seconds since 1/1/1970, gmt
"timeInterval",	// convert to days+hh:mm:ss
"localTimeString",	// Unix ctime format
"gmtTimeString"	// Unix ctime format


- Nick
 

Condor Classads Info:
http://www.cs.wisc.edu/condor/classad/




[← Prev in Thread] Current Thread [Next in Thread→]