dragon.ir.query
Class AbstractIRQuery

java.lang.Object
  |
  +--dragon.ir.query.AbstractIRQuery
All Implemented Interfaces:
IRQuery
Direct Known Subclasses:
AbstractPredicate, RelBoolQuery, RelSimpleQuery

public abstract class AbstractIRQuery
extends java.lang.Object
implements IRQuery

Abstract class of IR query

Copyright: Copyright (c) 2005

Company: IST, Drexel University

Version:
1.0
Author:
Davis Zhou

Field Summary
protected  java.util.ArrayList children
           
protected  Operator optr
           
 
Constructor Summary
AbstractIRQuery()
           
 
Method Summary
 IRQuery getChild(int index)
           
 int getChildNum()
           
 Operator getOperator()
           
 int getQueryKey()
           
 double getSelectivity()
           
protected  java.lang.String[] getTokenList(java.lang.String query)
           
 boolean isCompoundQuery()
          If the current query denotes a simple predicate, this method returns false, otherwise true.
 boolean isPredicate()
          A predicate always begins with a ltter T (term predicate), R(relation predicate), or M(modifier predicate)
 boolean isRelBoolQuery()
           
 boolean isRelSimpleQuery()
           
 boolean parse(java.lang.String query)
           
protected abstract  void parse(java.lang.String[] expression)
           
 void setQueryKey(int key)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

optr

protected Operator optr

children

protected java.util.ArrayList children
Constructor Detail

AbstractIRQuery

public AbstractIRQuery()
Method Detail

getQueryKey

public int getQueryKey()
Specified by:
getQueryKey in interface IRQuery
Returns:
the unique id of the query

setQueryKey

public void setQueryKey(int key)
Specified by:
setQueryKey in interface IRQuery

isPredicate

public boolean isPredicate()
Description copied from interface: IRQuery
A predicate always begins with a ltter T (term predicate), R(relation predicate), or M(modifier predicate)

Specified by:
isPredicate in interface IRQuery
Returns:
true if the the current query denotes a simple predicate, otherwise false.

isCompoundQuery

public boolean isCompoundQuery()
Description copied from interface: IRQuery
If the current query denotes a simple predicate, this method returns false, otherwise true.

Specified by:
isCompoundQuery in interface IRQuery
Returns:
false if the the current query denotes a simple predicate, otherwise true.

isRelSimpleQuery

public boolean isRelSimpleQuery()
Specified by:
isRelSimpleQuery in interface IRQuery

isRelBoolQuery

public boolean isRelBoolQuery()
Specified by:
isRelBoolQuery in interface IRQuery

parse

public boolean parse(java.lang.String query)
Specified by:
parse in interface IRQuery
Parameters:
query - the query string
Returns:
a structured query

getChildNum

public int getChildNum()
Specified by:
getChildNum in interface IRQuery

getChild

public IRQuery getChild(int index)
Specified by:
getChild in interface IRQuery

getSelectivity

public double getSelectivity()
Specified by:
getSelectivity in interface IRQuery

getOperator

public Operator getOperator()
Specified by:
getOperator in interface IRQuery

toString

public java.lang.String toString()
Specified by:
toString in interface IRQuery
Overrides:
toString in class java.lang.Object

getTokenList

protected java.lang.String[] getTokenList(java.lang.String query)

parse

protected abstract void parse(java.lang.String[] expression)