MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.opt.expr
Class CompareLiteral

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

public final class CompareLiteral
extends Literal

Represents a compare literal in a conjunction term


Field Summary
static int DEPENDENCY_END_END
           
static int DEPENDENCY_END_STARTEND
           
static int DEPENDENCY_NO_END
           
static int DEPENDENCY_NO_NO
           
static int DEPENDENCY_NO_START
           
static int DEPENDENCY_NO_STARTEND
           
static int DEPENDENCY_START_END
           
static int DEPENDENCY_START_START
           
static int DEPENDENCY_START_STARTEND
           
static int DEPENDENCY_STARTEND_STARTEND
           
 
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
CompareLiteral(XDMIterator iter, int comparator, int compareType, ValueLiteral leftLiteral, ValueLiteral rightLiteral)
           
 
Method Summary
 java.lang.Object clone()
          Creates a deep copy!
 int compareTo(java.lang.Object o)
          Needed to compare literals depending on their dependencies
 boolean equals(java.lang.Object obj)
           
 int getComparator()
          Returns the comparator id (based on CompareIterator constants)
 int getCompareDependency()
          Returns the compare dependency
static java.lang.String getCompareDependencyName(int dep)
           
 int getCompareType()
          Returns the comparator type (value, general, node based on CompareIterator constants)
 ValueLiteral getLeftLiteral()
          Returns the left part of the comparison (this part has always a lower dependency than the right part
 ValueLiteral getRightLiteral()
          Returns the left part of the comparison (this part has always a higher dependency than the right part
 int hashCode()
           
 int reset(int level)
          Resets the logical unit up to a certain degree on variable dependency
 KXmlSerializer traverse(KXmlSerializer serializer)
          Just for debugging
 
Methods inherited from class ch.ethz.mxquery.opt.expr.Literal
evaluate, getIter
 
Methods inherited from class ch.ethz.mxquery.opt.expr.LogicalUnit
addDependency, getDependency, getDependencyName, getDependencyNb, getResult, isDependendOnEnd, isDependendOnStart, isIndexable, isLowerDependency, isLowerOrEqualDependency, setDependency, setIndexable
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEPENDENCY_NO_NO

public static final int DEPENDENCY_NO_NO
See Also:
Constant Field Values

DEPENDENCY_NO_START

public static final int DEPENDENCY_NO_START
See Also:
Constant Field Values

DEPENDENCY_NO_STARTEND

public static final int DEPENDENCY_NO_STARTEND
See Also:
Constant Field Values

DEPENDENCY_NO_END

public static final int DEPENDENCY_NO_END
See Also:
Constant Field Values

DEPENDENCY_START_START

public static final int DEPENDENCY_START_START
See Also:
Constant Field Values

DEPENDENCY_START_END

public static final int DEPENDENCY_START_END
See Also:
Constant Field Values

DEPENDENCY_START_STARTEND

public static final int DEPENDENCY_START_STARTEND
See Also:
Constant Field Values

DEPENDENCY_END_END

public static final int DEPENDENCY_END_END
See Also:
Constant Field Values

DEPENDENCY_END_STARTEND

public static final int DEPENDENCY_END_STARTEND
See Also:
Constant Field Values

DEPENDENCY_STARTEND_STARTEND

public static final int DEPENDENCY_STARTEND_STARTEND
See Also:
Constant Field Values
Constructor Detail

CompareLiteral

public CompareLiteral(XDMIterator iter,
                      int comparator,
                      int compareType,
                      ValueLiteral leftLiteral,
                      ValueLiteral rightLiteral)
Method Detail

getComparator

public int getComparator()
Returns the comparator id (based on CompareIterator constants)

Returns:
a comparator type (see ch.ethz.mxquery.model.Constants)

getCompareType

public int getCompareType()
Returns the comparator type (value, general, node based on CompareIterator constants)

Returns:
a compare type (see ch.ethz.mxquery.model.Constants)

getCompareDependency

public int getCompareDependency()
Returns the compare dependency

Returns:
one of the dependency types

getLeftLiteral

public ValueLiteral getLeftLiteral()
Returns the left part of the comparison (this part has always a lower dependency than the right part

Returns:
the first/left ValueLiteral

getRightLiteral

public ValueLiteral getRightLiteral()
Returns the left part of the comparison (this part has always a higher dependency than the right part

Returns:
the second/right ValueLiteral

compareTo

public int compareTo(java.lang.Object o)
Needed to compare literals depending on their dependencies

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class LogicalUnit
Returns:
-1 of this logical unit is small, 0 if equal, 1 if this is greater

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clone

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

Overrides:
clone in class Literal

traverse

public KXmlSerializer traverse(KXmlSerializer serializer)
Just for debugging

Specified by:
traverse in interface Traversable
Overrides:
traverse in class Literal

reset

public 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

getCompareDependencyName

public static java.lang.String getCompareDependencyName(int dep)

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich