Terrier IR Platform
1.1.1

uk.ac.gla.terrier.querying.parser
Class Query

java.lang.Object
  extended by uk.ac.gla.terrier.querying.parser.Query
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
FieldQuery, MultiTermQuery, RequirementQuery, SingleTermQuery

public abstract class Query
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

An abstract class that models a query, that consists of subqueries and query terms. The subqueries can be phrase queries, field queries, required queries, and combinations of those queries.

Version:
$Revision: 1.17 $
Author:
Vassilis Plachouras & Craig Macdonald
See Also:
Serialized Form

Constructor Summary
Query()
           
 
Method Summary
 boolean applyTermPipeline(TermPipelineAccessor tpa)
          Applies a term pipeline in the query's terms, through the given term pipeline accessor.
 java.lang.Object clone()
          Deep copy this Query object
abstract  void getTermsOf(java.lang.Class c, java.util.ArrayList alist, boolean req)
          Returns all the query terms, in subqueries that are instances of a given class
 void obtainAllOf(java.lang.Class c, java.util.ArrayList a)
           
 boolean obtainControls(java.util.HashSet allowed, java.util.Hashtable controls)
           
 void obtainQueryTerms(MatchingQueryTerms terms)
          Stores the terms of the query in an structure used for matching documents to the query.
 void obtainQueryTerms(MatchingQueryTerms terms, boolean required)
          Stores the terms of the query in an structure used for matching documents to the query.
 void setChild(Query q)
          Sets the subquery object of this query.
abstract  java.lang.String toString()
          Force anything concrete to provide toString method
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Query

public Query()
Method Detail

clone

public java.lang.Object clone()
Deep copy this Query object

Overrides:
clone in class java.lang.Object

toString

public abstract java.lang.String toString()
Force anything concrete to provide toString method

Overrides:
toString in class java.lang.Object

getTermsOf

public abstract void getTermsOf(java.lang.Class c,
                                java.util.ArrayList alist,
                                boolean req)
Returns all the query terms, in subqueries that are instances of a given class

Parameters:
c - Class a class of queries.
alist - ArrayList the list of query terms.
req - boolean indicates whether it the subqueries are required or not.

setChild

public void setChild(Query q)
Sets the subquery object of this query.

Parameters:
q - Query the subquery object.

applyTermPipeline

public boolean applyTermPipeline(TermPipelineAccessor tpa)
Applies a term pipeline in the query's terms, through the given term pipeline accessor.

Parameters:
tpa - TermPipelineAccessor the object that provides access to the term pipeline.
Returns:
boolean true if the query is not empty, otherwise returns false.

obtainControls

public boolean obtainControls(java.util.HashSet allowed,
                              java.util.Hashtable controls)

obtainQueryTerms

public void obtainQueryTerms(MatchingQueryTerms terms)
Stores the terms of the query in an structure used for matching documents to the query.

Parameters:
terms - MatchingQueryTerms the structure that is used for modelling a query for matching.

obtainQueryTerms

public void obtainQueryTerms(MatchingQueryTerms terms,
                             boolean required)
Stores the terms of the query in an structure used for matching documents to the query.

Parameters:
terms - MatchingQueryTerms the structure that is used for modelling a query for matching.
required - boolean specifies whether the subqueries are required or not.

obtainAllOf

public void obtainAllOf(java.lang.Class c,
                        java.util.ArrayList a)

Terrier IR Platform
1.1.1

Terrier Information Retrieval Platform 1.1.1. Copyright 2004-2007 University of Glasgow