MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.opt.expr
Class CTerm

java.lang.Object
  extended by ch.ethz.mxquery.opt.expr.LogicalUnit
      extended by ch.ethz.mxquery.opt.expr.Term
          extended by ch.ethz.mxquery.opt.expr.CTerm
All Implemented Interfaces:
Traversable, java.lang.Cloneable, java.lang.Comparable

public final class CTerm
extends Term

This term presents a conjunction term. It also implements the logic for conjunctions to allow short circuit


Field Summary
 boolean indexed
           
 
Fields inherited from class ch.ethz.mxquery.opt.expr.LogicalUnit
DEPENDENCY_END, DEPENDENCY_NO, DEPENDENCY_START, DEPENDENCY_STARTEND, INDEX_IMPOSSIBLE, INDEX_POSSIBLE, INDEX_RECOMMEND, RESET, RESULT_FALSE, RESULT_TRUE, RESULT_UNKNOWN
 
Constructor Summary
CTerm()
           
 
Method Summary
 void addLiteral(Literal literal)
          Adds a new literal to the conjunction term
 int evaluate(int level)
          Evaluates the conjunction term up to a certain dependency level.
 CompareLiteralIndexSchema getIndexSchema(int indexNb)
           
 Literal getLiteral(int i)
          Returns the literal from position i from this conjunction term
 boolean isCompleteIndexable()
          Checks if the CTerm is complete indexable
 boolean isIndexed()
          Returns if this conjunction term is indexed
 int reset(int level)
          Resets the logical unit up to a certain degree on variable dependency
 void setIndexed(boolean indexed)
          Sets if this conjunction term is indexed
 
Methods inherited from class ch.ethz.mxquery.opt.expr.Term
add, addAll, clone, get, size, sort, traverse
 
Methods inherited from class ch.ethz.mxquery.opt.expr.LogicalUnit
addDependency, compareTo, getDependency, getDependencyName, getDependencyNb, getResult, isDependendOnEnd, isDependendOnStart, isIndexable, isLowerDependency, isLowerOrEqualDependency, setDependency, setIndexable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexed

public boolean indexed
Constructor Detail

CTerm

public CTerm()
Method Detail

isIndexed

public boolean isIndexed()
Returns if this conjunction term is indexed

Returns:
true if indexed

setIndexed

public void setIndexed(boolean indexed)
Sets if this conjunction term is indexed


addLiteral

public void addLiteral(Literal literal)
Adds a new literal to the conjunction term

Parameters:
literal -

getLiteral

public Literal getLiteral(int i)
Returns the literal from position i from this conjunction term

Parameters:
i - position of the literal

evaluate

public int evaluate(int level)
             throws MXQueryException
Evaluates the conjunction term up to a certain dependency level. Additional this evaluate makes use of short circuit

Specified by:
evaluate in class Term
Parameters:
level - Up to this dependency level the unit is evaluated
Returns:
false, true or unknown
Throws:
MXQueryException

reset

public int reset(int level)
Description copied from class: LogicalUnit
Resets the logical unit up to a certain degree on variable dependency

Specified by:
reset in class Term
Returns:
UNKNOWN, TRUE or FALSE

getIndexSchema

public CompareLiteralIndexSchema getIndexSchema(int indexNb)

isCompleteIndexable

public boolean isCompleteIndexable()
Checks if the CTerm is complete indexable

Returns:
true if all components can be indexed, false otherwise

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich