org.egothor.query
Class QNot

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

public class QNot
extends Query

The QNot class represents a NOT formula. The user has made a query for documents containing termA, but NOT termB.

Author:
Leo Galambos

Field Summary
 
Fields inherited from class org.egothor.core.query.Query
MODEL_BOOLEAN, MODEL_FUZZY_M, MODEL_VECTOR
 
Constructor Summary
QNot(Query a, Query b)
          Constructor for the QNot object.
QNot(Query a, Query b, boolean required, boolean prohibited)
          Constructor for the QNot 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 QNot object with the given CWI applied to both sides of the query.
 Runner attach(Rider r)
          Return an NotRunner 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 QNot object
 void setModel(int model)
          Sets the model attribute of the QNot 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, setProhibited, setRequired, setUnknown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QNot

public QNot(Query a,
            Query b)
Constructor for the QNot object. This constructor creates an object for the formula a NOT b.

Parameters:
a - the query to include
b - the query to exclude

QNot

public QNot(Query a,
            Query b,
            boolean required,
            boolean prohibited)
Constructor for the QNot object.

Parameters:
a - the query to include
b - the query to exclude
required - set to true if the entire query (both items) are required for a hit
prohibited - set to true if the entire query (both items) should not be in a hit
Method Detail

setModel

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

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

getNodeName

public java.lang.String getNodeName()
Gets the nodeName attribute of the QNot 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:
queryA NOT queryB

attach

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

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

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 QNot 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.