condor.classad
Class Query

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
     SelectionList: [ SelectionList ',' ] Identifier [ '=' Expression ]
     WhereClause : [ 'where' Expression ]
 

Version:
2.0
Author:
Marvin Solomon

Field Summary
 String fromClause
          The "from" clause (original case preserved).
 Expr[] selectClause
          The expressions in the SelectionClause.
 String[] selectNames
          The Identifiers in the SelectionClause.
 Expr whereClause
          The "where" clause or null if the "where" clause was omitted.
 
Constructor Summary
Query(Expr[] s, String[] n, String f, Expr w)
          Construct a query from its components.
 
Method Summary
static Query parse(ClassAdParser parser)
          Create a Query from an exsiting parser.
static Query parse(InputStream s)
          Create a Query by parsing input from an InputStream.
static Query parse(Reader s)
          Create a Query by parsing input from a Reader.
static Query parse(String s)
          Create a Query by parsing a String.
 String toString()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

selectClause

public final Expr[] selectClause
The expressions in the SelectionClause. If the clause was "*", this field is null. Otherwise, it has one element for each "Identifier = Expression" or "Identifier" in the SelectionList. The element is the Expression if present; otherwise, it is AttrRef expression corresponding to the Identifier.


selectNames

public final String[] selectNames
The Identifiers in the SelectionClause. If the clause was "*", this field is null. Otherwise, it has one element for each "Identifier = Expression" or "Identifier" in the SelectionList. If the Expression is present, the element is the original Identifier (with case preserved). Otherwise, it is null.


fromClause

public String fromClause
The "from" clause (original case preserved).


whereClause

public Expr whereClause
The "where" clause or null if the "where" clause was omitted.

Constructor Detail

Query

public Query(Expr[] s,
             String[] n,
             String f,
             Expr w)
Construct a query from its components.

Parameters:
s - the "select" clause expressions.
n - the "select" clause identifiers.
f - the "from" clause.
w - the "where" clause (or null).
Method Detail

parse

public static Query parse(InputStream s)
Create a Query by parsing input from an InputStream.

Parameters:
s - the input source.
Returns:
a new Query object.

parse

public static Query parse(Reader s)
Create a Query by parsing input from a Reader.

Parameters:
s - input source.
Returns:
a new Query object.

parse

public static Query parse(String s)
Create a Query by parsing a String.

Parameters:
s - the input source.
Returns:
a new Query object.

parse

public static Query parse(ClassAdParser parser)
Create a Query from an exsiting parser.

Parameters:
parser - the input source.
Returns:
a new Query object.

toString

public String toString()
Overrides:
toString in class Object