FileDocCategorySizeDatePackage
BooleanClause.javaAPI DocApache Lucene 2.0.03203Fri May 26 09:54:18 BST 2006org.apache.lucene.search

BooleanClause

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

Fields Summary
private Query
query
The query whose matching documents are combined by the boolean query.
private Occur
occur
Constructors Summary
public BooleanClause(Query query, Occur occur)
Constructs a BooleanClause.



        
       
    this.query = query;
    this.occur = occur;
    
  
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.occur.equals(other.occur);
  
public org.apache.lucene.search.BooleanClause$OccurgetOccur()

    return occur;
  
public org.apache.lucene.search.QuerygetQuery()

    return query;
  
public inthashCode()
Returns a hash code value for this object.

    return query.hashCode() ^ (Occur.MUST.equals(occur)?1:0) ^ (Occur.MUST_NOT.equals(occur)?2:0);
  
public booleanisProhibited()

    return Occur.MUST_NOT.equals(occur);
  
public booleanisRequired()

    return Occur.MUST.equals(occur);
  
public voidsetOccur(org.apache.lucene.search.BooleanClause$Occur occur)

    this.occur = occur;

  
public voidsetQuery(org.apache.lucene.search.Query query)

    this.query = query;
  
public java.lang.StringtoString()

    return occur.toString() + query.toString();