FileDocCategorySizeDatePackage
BooleanClause.javaAPI DocApache Lucene 1.4.31899Tue Mar 30 00:48:04 BST 2004org.apache.lucene.search

BooleanClause

public class BooleanClause extends Object implements Serializable
A clause in a BooleanQuery.

Fields Summary
public Query
query
The query whose matching documents are combined by the boolean query.
public boolean
required
If true, documents documents which do not match this sub-query will not match the boolean query.
public boolean
prohibited
If true, documents documents which do match this sub-query will not match the boolean query.
Constructors Summary
public BooleanClause(Query q, boolean r, boolean p)
Constructs a BooleanClause with query q, required r and prohibited p.

  
                  
         
    query = q;
    required = r;
    prohibited = p;
  
Methods Summary
public booleanequals(java.lang.Object o)
Returns true iff o is equal to this.

    if (!(o instanceof BooleanClause))
      return false;
    BooleanClause other = (BooleanClause)o;
    return this.query.equals(other.query)
      && (this.required == other.required)
      && (this.prohibited == other.prohibited);
  
public inthashCode()
Returns a hash code value for this object.

    return query.hashCode() ^ (this.required?1:0) ^ (this.prohibited?2:0);