org.egothor.query
Class QProx

java.lang.Object
  extended by org.egothor.core.query.Query
      extended by org.egothor.query.QProx

public class QProx
extends Query

The QProx object represents an digit operator in a query. The user has made a query for documents containing termA within x words of termB.

Author:
Leo Galambos

Field Summary
 
Fields inherited from class org.egothor.core.query.Query
MODEL_BOOLEAN, MODEL_FUZZY_M, MODEL_VECTOR
 
Constructor Summary
QProx(QTerm a, QTerm b)
          Constructor for the QProx object.
QProx(QTerm a, QTerm b, java.lang.String num)
          Constructor for the QProx object.
 
Method Summary
 void addTerms(java.util.HashSet<Token> to)
          Add the given HashSet of terms to this Query.
 Query applyCWI(CWI cwi)
          Return a QProx object with the given CWI applied to both sides of the query.
 Runner attach(Rider r)
          Return an ProxRunner which is the binary representation of this clausula.
 org.w3c.dom.Node explain(org.w3c.dom.Document doc)
          Description of the Method
 java.lang.String getNodeName()
          Gets the nodeName attribute of the QProx object
 void setModel(int model)
          Sets the model attribute of the QProx object
 void setProhibited()
          Sets the prohibited attribute of the QProx object
 void setRequired()
          Sets the required attribute of the QProx object
 java.lang.String toString()
          Return a string representation of this object.
 
Methods inherited from class org.egothor.core.query.Query
getExcluded, getModel, getProhibited, getRequired, getUnknown, isRequiredOrProhibited, setExcluded, setUnknown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QProx

public QProx(QTerm a,
             QTerm b,
             java.lang.String num)
Constructor for the QProx object.

Parameters:
a - the first query
b - the second query
num - the allowable distance between a and b

QProx

public QProx(QTerm a,
             QTerm b)
Constructor for the QProx object.

Parameters:
a - the first query
b - the second query
Method Detail

setModel

public void setModel(int model)
Sets the model attribute of the QProx object

Overrides:
setModel in class Query
Parameters:
model - The new model value

setProhibited

public void setProhibited()
Sets the prohibited attribute of the QProx object

Overrides:
setProhibited in class Query

setRequired

public void setRequired()
Sets the required attribute of the QProx object

Overrides:
setRequired in class Query

getNodeName

public java.lang.String getNodeName()
Gets the nodeName attribute of the QProx object

Specified by:
getNodeName in class Query
Returns:
The nodeName value

explain

public org.w3c.dom.Node explain(org.w3c.dom.Document doc)
Description of the Method

Overrides:
explain in class Query
Parameters:
doc - Description of the Parameter
Returns:
Description of the Return Value

toString

public java.lang.String toString()
Return a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
queryA ~the desired distance~ queryB

attach

public Runner attach(Rider r)
Return an ProxRunner which is the binary representation of this clausula.

Overrides:
attach in class Query
Parameters:
r - the Rider
Returns:
an AndRunner

addTerms

public void addTerms(java.util.HashSet<Token> to)
Add the given HashSet of terms to this Query.

Overrides:
addTerms in class Query
Parameters:
to - a HashSet containing the terms to be added

applyCWI

public Query applyCWI(CWI cwi)
Return a QProx object with the given CWI applied to both sides of the query.

Overrides:
applyCWI in class Query
Parameters:
cwi - the CWI
Returns:
a Query. When the CWI is null, it simply returns this object.