dragon.ir.query
Class AbstractPredicate
java.lang.Object
|
+--dragon.ir.query.AbstractIRQuery
|
+--dragon.ir.query.AbstractPredicate
- All Implemented Interfaces:
- IRQuery, Predicate
- Direct Known Subclasses:
- BoolQualifierPredicate, BoolRelationPredicate, BoolTermPredicate, SimpleRelationPredicate, SimpleTermPredicate
- public abstract class AbstractPredicate
- extends AbstractIRQuery
- implements Predicate
Abstract class of predicate
Copyright: Copyright (c) 2005
Company: IST, Drexel University
- Version:
- 1.0
- Author:
- Davis Zhou
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
weight
protected double weight
predicateType
protected int predicateType
expressionType
protected int expressionType
constraint
protected Expression constraint
AbstractPredicate
public AbstractPredicate()
parse
public boolean parse(java.lang.String predicate)
- Specified by:
parse in interface IRQuery- Overrides:
parse in class AbstractIRQuery
- Parameters:
predicate - the query string
- Returns:
- a structured query
getOperator
public Operator getOperator()
- Specified by:
getOperator in interface IRQuery- Overrides:
getOperator in class AbstractIRQuery
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- Overrides:
isPredicate in class AbstractIRQuery
- 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- Overrides:
isCompoundQuery in class AbstractIRQuery
- Returns:
- false if the the current query denotes a simple predicate, otherwise true.
getChild
public IRQuery getChild(int index)
- Specified by:
getChild in interface IRQuery- Overrides:
getChild in class AbstractIRQuery
getChildNum
public int getChildNum()
- Specified by:
getChildNum in interface IRQuery- Overrides:
getChildNum in class AbstractIRQuery
getSelectivity
public double getSelectivity()
- Specified by:
getSelectivity in interface Predicate- Overrides:
getSelectivity in class AbstractIRQuery
- Returns:
- a double socre indicating how specific the query predicate is.
getWeight
public double getWeight()
- Specified by:
getWeight in interface Predicate
setWeight
public void setWeight(double weight)
- Specified by:
setWeight in interface Predicate
getConstraint
public Expression getConstraint()
- Specified by:
getConstraint in interface Predicate
- Returns:
- the underlying expression of the current predicate
isSimplePredicate
public boolean isSimplePredicate()
- Specified by:
isSimplePredicate in interface Predicate
isBoolPredicate
public boolean isBoolPredicate()
- Specified by:
isBoolPredicate in interface Predicate
isTermPredicate
public boolean isTermPredicate()
- Specified by:
isTermPredicate in interface Predicate
isRelationPredicate
public boolean isRelationPredicate()
- Specified by:
isRelationPredicate in interface Predicate
isQualifierPredicate
public boolean isQualifierPredicate()
- Specified by:
isQualifierPredicate in interface Predicate
parse
protected abstract void parse(java.lang.String[] predicate)
- Specified by:
parse in class AbstractIRQuery