MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.opt.expr
Class Term

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

public abstract class Term
extends LogicalUnit

A term for the optimization. A term consits again of logical units, which can be in turn again terms, literal etc.


Field Summary
 
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
Term()
           
 
Method Summary
 void add(LogicalUnit unit)
          Adds a new logical unit to the term
 void addAll(Term term)
          Adds a list of terms into this term.
 java.lang.Object clone()
          Creates a copy.
abstract  int evaluate(int level)
          Evaluates the logical unit until a certain degree on variable dependency and returns if the result is false, true or unknown
 LogicalUnit get(int i)
           
abstract  int reset(int level)
          Resets the logical unit up to a certain degree on variable dependency
 int size()
          Returns the number of logical units in this term
 void sort()
          Sorts the result list according to the used variables
 KXmlSerializer traverse(KXmlSerializer serializer)
           
 
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
 

Constructor Detail

Term

public Term()
Method Detail

get

public LogicalUnit get(int i)

addAll

public void addAll(Term term)
Adds a list of terms into this term.

Parameters:
term -

size

public int size()
Returns the number of logical units in this term

Returns:
the number of logical units

add

public void add(LogicalUnit unit)
Adds a new logical unit to the term

Parameters:
unit -

sort

public void sort()
Sorts the result list according to the used variables


evaluate

public abstract int evaluate(int level)
                      throws MXQueryException
Description copied from class: LogicalUnit
Evaluates the logical unit until a certain degree on variable dependency and returns if the result is false, true or unknown

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

reset

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

Overrides:
reset in class LogicalUnit
Returns:
UNKNOWN, TRUE or FALSE

clone

public java.lang.Object clone()
Creates a copy.


traverse

public KXmlSerializer traverse(KXmlSerializer serializer)
Specified by:
traverse in interface Traversable
Overrides:
traverse in class LogicalUnit

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich