Class query.ProxOp
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class query.ProxOp

java.lang.Object
   |
   +----query.ExpNode
           |
           +----query.ProxOp

public class ProxOp
extends ExpNode
implements STARTSnode, FilterNode, RankingNode
An ExpNode that represents a Proximity Operator in either a ranking or filter expression. ProxOp nodes have two children (both of which are always terms) and two properties: distance - an integer value which is the proximity distance wordOrderMatters - a boolean value determining whether word order matters in the proximity

Constructor Index

 o ProxOp(Query, int, boolean)
Build a new ProxOp.

Method Index

 o Check()
Do sanity checking and source support checking for this ProxOp.
 o ExtractTerms(Vector)
Recurse through this sub-tree to extract the terms within
 o GetDistance()
return the proximity distance
 o TranslateToFilter()
Return a new ExpNode representing the source-specific translation of this ProxOp in the context of a filter expression.
 o TranslateToRanking()
Return a new ExpNode representing the source-specific translation of this ProxOp in the context of a filter expression.
 o Unparse()
Return the String representation of this proximity sub-tree
 o WordOrderMatters_p()
predicate determining whether word order matters in this proximity operator.

Constructors

 o ProxOp
  public ProxOp(Query query,
                int distance,
                boolean wordOrderMatters)
Build a new ProxOp.
Parameters:
query - the query context of the ProxOp
distance - integer distance value of the proximity operator
wordOrderMatters - boolean value determining whether word order matters inthe proximity

Methods

 o GetDistance
  public int GetDistance()
return the proximity distance
Returns:
the integer value of the proximity distance.
 o WordOrderMatters_p
  public boolean WordOrderMatters_p()
predicate determining whether word order matters in this proximity operator.
Returns:
true or false depending if word order matters for this proximity operator;
 o Unparse
  public String Unparse()
Return the String representation of this proximity sub-tree
Returns:
the String equivalent of this ProxOp rooted sub-tree
Overrides:
Unparse in class ExpNode
 o Check
  public ExpNode Check() throws UnsupportedQueryException
Do sanity checking and source support checking for this ProxOp. For example, STARTS filter syntax does not prohibit expressions like (author="foo") prox (title = "bar"). If everything passes tests ok recurse down to the children.
Returns:
The transformed sub-tree resulting from the check operation
Throws: UnsupportedQueryException
if an error is found in the subtree.
 o TranslateToFilter
  public ExpNode TranslateToFilter() throws SourceQueryException
Return a new ExpNode representing the source-specific translation of this ProxOp in the context of a filter expression.
Returns:
The sub-tree that is the source filter equivalent of the ProxOp sub-tree.
Throws: SourceQueryException
if an error occurs during the translation.
 o TranslateToRanking
  public ExpNode TranslateToRanking() throws SourceQueryException
Return a new ExpNode representing the source-specific translation of this ProxOp in the context of a filter expression.
Returns:
The sub-tree that is the source filter equivalent of the ProxOp sub-tree.
Throws: SourceQueryException
if an error occurs during the translation.
 o ExtractTerms
  public void ExtractTerms(Vector termVector)
Recurse through this sub-tree to extract the terms within
Parameters:
termVector - Vector of terms extracted.

All Packages  Class Hierarchy  This Package  Previous  Next  Index