org.z3950.zing.cql
Class CQLSortNode

java.lang.Object
  extended by org.z3950.zing.cql.CQLNode
      extended by org.z3950.zing.cql.CQLSortNode

public class CQLSortNode
extends CQLNode

Represents a sort node in a CQL parse-tree.

Version:
$Id: CQLSortNode.java,v 1.2 2008-04-11 12:05:15 mike Exp $

Field Summary
 CQLNode subtree
          The root of a subtree representing the query whose result is to be sorted.
 
Fields inherited from class org.z3950.zing.cql.CQLNode
APPLICATION, BITSTRING, BOOLEAN, CONSTRUCTED, CONTEXT, ENUMERATED, EXTERNAL, GENERALSTRING, INTEGER, NULL, OBJECTDESCRIPTOR, OBJECTIDENTIFIER, OCTETSTRING, PRIMITIVE, PRIVATE, SEQUENCE, SET, UNIVERSAL, VISIBLESTRING
 
Constructor Summary
CQLSortNode(CQLNode subtree)
           
 
Method Summary
 void addSortIndex(ModifierSet key)
           
 java.util.Vector<ModifierSet> getSortIndexes()
           
 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.
 byte[] toType1BER(java.util.Properties config)
          Renders a parser-tree into a BER-endoded packet representing an equivalent Z39.50 Type-1 query.
 java.lang.String toXCQL(int level, java.util.Vector<CQLPrefix> prefixes, java.util.Vector<ModifierSet> sortkeys)
           
 
Methods inherited from class org.z3950.zing.cql.CQLNode
getResultSetName, indent, lenLen, makeOID, makeQuery, numLen, putLen, putNum, putTag, renderPrefixes, renderSortKeys, toXCQL, toXCQL, xq
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subtree

public CQLNode subtree
The root of a subtree representing the query whose result is to be sorted.

Constructor Detail

CQLSortNode

public CQLSortNode(CQLNode subtree)
Method Detail

addSortIndex

public void addSortIndex(ModifierSet key)

getSortIndexes

public java.util.Vector<ModifierSet> getSortIndexes()

toXCQL

public java.lang.String toXCQL(int level,
                               java.util.Vector<CQLPrefix> prefixes,
                               java.util.Vector<ModifierSet> sortkeys)
Specified by:
toXCQL in class CQLNode

toCQL

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

Specified by:
toCQL in class 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.

Specified by:
toPQF in class CQLNode
Parameters:
config - A Properties object containing configuration information that specifies the mapping from CQL indexes, relations, etc. to Type-1 attributes. The mapping specification is described in the CQL-Java distribution's sample PQF-mapping configuration file, etc/pqf.properties, which see.
Returns:
A String containing a PQF query equivalent to the parse-tree whose root is this node.
Throws:
PQFTranslationException

toType1BER

public byte[] toType1BER(java.util.Properties config)
                  throws PQFTranslationException
Description copied from class: CQLNode
Renders a parser-tree into a BER-endoded packet representing an equivalent Z39.50 Type-1 query. If you don't know what that means, then you don't need this method :-) This is useful primarily for SRW-to-Z39.50 gateways.

Specified by:
toType1BER in class CQLNode
Parameters:
config - A Properties object containing configuration information that specifies the mapping from CQL indexes, relations, etc. to Type-1 attributes. The mapping specification is described in the CQL-Java distribution's sample PQF-mapping configuration file, etc/pqf.properties, which see.
Returns:
A byte array containing the BER packet.
Throws:
PQFTranslationException
See Also:
ftp://ftp.rsasecurity.com/pub/pkcs/ascii/layman.asc