condor.classad
Class Query

java.lang.Object
  |
  +--condor.classad.Query

public class Query
extends Object

A parsed "query" in a very simple ad hoc query language inspired by SQL. This is a hack desiged to test the ClassAd machinery by sending a query to Condor Collector and interpreting the results. A query has the form

     Query: 'select' SelectClause 'from' Identifier WhereClause
     SelectClause: '*' | SelectionList
     WhereClause : [ 'where' Expression ]
     SelectionList: [ SelectionList ',' ] Identifier [ '=' Expression ]
 


Field Summary
 String fromClause
          The "from" clause (as a string).
 RecordExpr selectClause
          The "select" clause, encoded as a RecordExpr.
 RecordExpr whereClause
          The "where" clause (as an expression of the form [Requirements = ...]), or null if the "where" clause was omitted.
 
Constructor Summary
Query(RecordExpr s, String f, RecordExpr w)
          Construct a query from its components.
 
Method Summary
static Query parse(InputStream s)
          Create a Query by parsing an input stream.
static Query parse(Reader s)
          Create a Query my parsing an input stream.
static Query parse(String s)
          Create a Query my parsing an input stream.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

selectClause

public RecordExpr selectClause
The "select" clause, encoded as a RecordExpr. The attribute names are the supplied <IDENTIFIERS>, or generated names of the form ``$argn'' if the <IDENTIFIER> is omitted.

fromClause

public String fromClause
The "from" clause (as a string).

whereClause

public RecordExpr whereClause
The "where" clause (as an expression of the form [Requirements = ...]), or null if the "where" clause was omitted.
Constructor Detail

Query

public Query(RecordExpr s,
             String f,
             RecordExpr w)
Construct a query from its components.
Parameters:
s - the "select" clause.
f - the "from" clause.
w - the "where" clause (or null).
Method Detail

parse

public static Query parse(InputStream s)
Create a Query by parsing an input stream.
Parameters:
s - the stream to parse.
Returns:
a new Query object.

parse

public static Query parse(Reader s)
Create a Query my parsing an input stream.
Parameters:
s - the stream to parse.
Returns:
a new Query object.

parse

public static Query parse(String s)
Create a Query my parsing an input stream.
Parameters:
s - the string to parse.
Returns:
a new Query object.

toString

public String toString()
Overrides:
toString in class Object