org.z3950.zing.cql
Class CQLProxNode

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

public class CQLProxNode
extends CQLBooleanNode

Represents a proximity node in a CQL parse-tree. The left- and right-hand-sides must be satisfied by parts of the candidate records which are sufficiently close to each other, as specified by a set of proximity parameters.

Version:
$Id: CQLProxNode.java,v 1.7 2002/12/05 17:14:52 mike Exp $

Field Summary
 
Fields inherited from class org.z3950.zing.cql.CQLBooleanNode
left, right
 
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
CQLProxNode(CQLNode left)
          Creates a new, incomplete, proximity node with the specified left-hand side.
 
Method Summary
 void addModifier(java.lang.String type, java.lang.String value)
          Adds a modifier of the specified type and value to a proximity node.
 void addSecondSubterm(CQLNode right)
          Sets the right-hand side of the proximity node whose left-hand-side was specified at creation time.
 java.util.Vector[] getModifiers()
          Returns an array of the modifiers associated with a proximity node.
 
Methods inherited from class org.z3950.zing.cql.CQLBooleanNode
toCQL, toPQF, toType1BER, toXCQL
 
Methods inherited from class org.z3950.zing.cql.CQLNode
getResultSetName, indent, lenLen, makeOID, makeQuery, numLen, putLen, putNum, putTag, renderPrefixes, toXCQL, xq
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CQLProxNode

public CQLProxNode(CQLNode left)
Creates a new, incomplete, proximity node with the specified left-hand side. No right-hand side is specified at this stage: that must be specified later, using the addSecondSubterm() method. (That may seem odd, but it's just easier to write the parser that way.)

Proximity paramaters may be added at any time, before or after the right-hand-side sub-tree is added.

Method Detail

addSecondSubterm

public void addSecondSubterm(CQLNode right)
Sets the right-hand side of the proximity node whose left-hand-side was specified at creation time.


addModifier

public void addModifier(java.lang.String type,
                        java.lang.String value)
Adds a modifier of the specified type and value to a proximity node. Valid types are relation, distance, unit and ordering.

For information on the semantics of these paramaters, see section 3.1 (Proximity) of A Gentle Introduction to CQL.


getModifiers

public java.util.Vector[] getModifiers()
Returns an array of the modifiers associated with a proximity node.

Returns:
An array of modifiers, each represented by a two-element Vector, in which element 0 is the modifier type (e.g. distance or ordering) and element 1 is the associated value (e.g. 3 or unordered).