org.z3950.zing.cql
Class CQLRelation

java.lang.Object
  |
  +--org.z3950.zing.cql.CQLNode
        |
        +--org.z3950.zing.cql.CQLRelation

public class CQLRelation
extends CQLNode

Represents a relation between a CQL qualifier and term.

Version:
$Id: CQLRelation.java,v 1.5 2002/11/06 20:13:45 mike Exp $

Constructor Summary
CQLRelation(java.lang.String base)
           
 
Method Summary
 void addModifier(java.lang.String modifier)
           
 java.lang.String getBase()
           
 java.lang.String[] getModifiers()
           
 java.lang.String toCQL()
          Decompiles a parse-tree into a CQL query.
 java.lang.String toPQF(java.util.Properties config)
          Renders a parse-tree into a Yaz-style PQF string.
 java.lang.String toXCQL(int level)
          Translates a parse-tree into an XCQL document.
 
Methods inherited from class org.z3950.zing.cql.CQLNode
indent, xq
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CQLRelation

public CQLRelation(java.lang.String base)
Method Detail

getBase

public java.lang.String getBase()

addModifier

public void addModifier(java.lang.String modifier)

getModifiers

public java.lang.String[] getModifiers()

toXCQL

public java.lang.String toXCQL(int level)
Description copied from class: CQLNode
Translates a parse-tree into an XCQL document.

Overrides:
toXCQL in class CQLNode
Following copied from class: org.z3950.zing.cql.CQLNode
Parameters:
level - The number of levels to indent the top element of the XCQL document. This will typically be 0 when invoked by an application; it takes higher values when this method is invoked recursively for nodes further down the tree.
Returns:
A String containing an XCQL document equivalent to the parse-tree whose root is this node.

toCQL

public java.lang.String toCQL()
Description copied from class: CQLNode
Decompiles a parse-tree into a CQL query.

Overrides:
toCQL in class CQLNode
Following copied from class: org.z3950.zing.cql.CQLNode
Returns:
A String containing a CQL query equivalent to the parse-tree whose root is this node, so that compiling that query will yield an identical tree.

toPQF

public java.lang.String toPQF(java.util.Properties config)
                       throws PQFTranslationException
Description copied from class: CQLNode
Renders a parse-tree into a Yaz-style PQF string.

query ::= top-set query-struct.
top-set ::= [ '@attrset' string ]
query-struct ::= attr-spec | simple | complex | '@term' term-type
attr-spec ::= '@attr' [ string ] string query-struct
complex ::= operator query-struct query-struct.
operator ::= '@and' | '@or' | '@not' | '@prox' proximity.
simple ::= result-set | term.
result-set ::= '@set' string.
term ::= string.
proximity ::= exclusion distance ordered relation which-code unit-code.
exclusion ::= '1' | '0' | 'void'.
distance ::= integer.
ordered ::= '1' | '0'.
relation ::= integer.
which-code ::= 'known' | 'private' | integer.
unit-code ::= integer.
term-type ::= 'general' | 'numeric' | 'string' | 'oid' | 'datetime' | 'null'.
 
Overrides:
toPQF in class CQLNode
Following copied from class: org.z3950.zing.cql.CQLNode
Returns:
A String containing a PQF query equivalent to the parse-tree whose root is this node. This may be fed into the tool of your choice to obtain a BER-encoded packet.