org.egothor.query
Class QTerm

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

public class QTerm
extends Query

The QTerm class represents a term. It is a special kind of a query. The QTerm object recognizes a String via a token which is defined in the Simple parser class.

Author:
Leo Galambos

Field Summary
 
Fields inherited from class org.egothor.core.query.Query
MODEL_BOOLEAN, MODEL_FUZZY_M, MODEL_VECTOR
 
Constructor Summary
QTerm(Token token, java.lang.String field)
          Constructor for the QTerm object.
QTerm(Token token, java.lang.String field, double idf, boolean req, boolean proh, int boost, int lowerBound, int upperBound)
          Constructor for the QTerm 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 QTerm object with the given CWI applied.
 Runner attach(Rider r)
          Return a TermRunner 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 QTerm object
 void setBoostFactor(int boost)
          Sets the boostFactor attribute of the QTerm object
 void setLowerBound(int boundary)
          Sets the lowerBound attribute of the QTerm object
 void setUpperBound(int boundary)
          Sets the upperBound attribute of the QTerm 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, setModel, setProhibited, setRequired, setUnknown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QTerm

public QTerm(Token token,
             java.lang.String field)
Constructor for the QTerm object.

Parameters:
token - the descriptive token of the term
field - the query field

QTerm

public QTerm(Token token,
             java.lang.String field,
             double idf,
             boolean req,
             boolean proh,
             int boost,
             int lowerBound,
             int upperBound)
Constructor for the QTerm object.

Parameters:
token - the token
field - in which field the token is (null=root field)
idf - the inverse document frequency
req - set to true if the term is required for a hit
proh - set to true if the term should not be in a hit
boost - Description of the Parameter
lowerBound - Description of the Parameter
upperBound - Description of the Parameter
Method Detail

setBoostFactor

public void setBoostFactor(int boost)
Sets the boostFactor attribute of the QTerm object

Parameters:
boost - The new boostFactor value

setLowerBound

public void setLowerBound(int boundary)
Sets the lowerBound attribute of the QTerm object

Parameters:
boundary - The new lowerBound value

setUpperBound

public void setUpperBound(int boundary)
Sets the upperBound attribute of the QTerm object

Parameters:
boundary - The new upperBound value

getNodeName

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

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

explain

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

Overrides:
explain in class Query
Parameters:
doc - Description of the Parameter
Returns:
Description of the Return Value
Throws:
org.w3c.dom.DOMException - Description of the Exception

toString

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

Overrides:
toString in class java.lang.Object
Returns:
[term:token]

attach

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

Overrides:
attach in class Query
Parameters:
r - the Rider
Returns:
a TermRunner

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 QTerm object with the given CWI applied.

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