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.7 2002/11/20 01:15:15 mike Exp $
Constructor Summary |
CQLRelation(java.lang.String base)
Creates a new CQLRelation with the specified base relation. |
Method Summary |
void |
addModifier(java.lang.String modifier)
Adds a new relation modifier to the specified CQLRelation. |
java.lang.String |
getBase()
Returns the base relation with which the CQLRelation was
originally created. |
java.lang.String[] |
getModifiers()
Returns an array of the modifiers associated with a CQLRelation. |
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,
java.util.Vector prefixes)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CQLRelation
public CQLRelation(java.lang.String base)
- Creates a new CQLRelation with the specified base relation.
Typical base relations include the usual six ordering relations
(<=, >, etc.), the text
relations any, all and exact and the
server-choice relation scr.
getBase
public java.lang.String getBase()
- Returns the base relation with which the CQLRelation was
originally created.
addModifier
public void addModifier(java.lang.String modifier)
- Adds a new relation modifier to the specified CQLRelation.
Typical relation modifiers include relevant,
fuzzy, stem and phonetic. On the
whole, these modifiers have a meaningful interpretation only
for the text relations.
getModifiers
public java.lang.String[] getModifiers()
- Returns an array of the modifiers associated with a CQLRelation.
- Returns:
- An array of zero or more Strings, each representing a
modifier associated with the specified CQLRelation.
toXCQL
public java.lang.String toXCQL(int level,
java.util.Vector prefixes)
- Overrides:
toXCQL
in class CQLNode
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
- Parameters:
config
- A Properties object containing configuration
information that specifies the mapping from CQL qualifiers,
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. This may be fed into the tool of
your choice to obtain a BER-encoded packet.