org.z3950.zing.cql
Class CQLPrefixNode

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

public class CQLPrefixNode
extends CQLNode

Represents a prefix node in a CQL parse-tree.

Version:
$Id: CQLPrefixNode.java,v 1.2 2002/11/14 22:07:32 mike Exp $

Field Summary
 CQLPrefix prefix
          The prefix definition that governs the subtree.
 CQLNode subtree
          The root of a parse-tree representing the part of the query that is governed by this prefix definition.
 
Constructor Summary
CQLPrefixNode(java.lang.String name, java.lang.String identifier, CQLNode subtree)
          Creates a new CQLPrefixNode inducing a mapping from the specified qualifier-set name to the specified identifier across the specified subtree.
 
Method Summary
 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
 

Field Detail

prefix

public CQLPrefix prefix
The prefix definition that governs the subtree.

subtree

public CQLNode subtree
The root of a parse-tree representing the part of the query that is governed by this prefix definition.
Constructor Detail

CQLPrefixNode

public CQLPrefixNode(java.lang.String name,
                     java.lang.String identifier,
                     CQLNode subtree)
Creates a new CQLPrefixNode inducing a mapping from the specified qualifier-set name to the specified identifier across the specified subtree.
Method Detail

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. PQF, or Prefix Query Format, is a cryptic but powerful notation that can be trivially mapped, one-to-one, int Z39.50 Type-1 and Type-101 queries. A specification for the format can be found in Chapter 7 (Supporting Tools) of the YAZ manual.

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.