Cumulus4j API
(1.0.0)

org.cumulus4j.store.query.eval
Class OrExpressionEvaluator

java.lang.Object
  extended by org.cumulus4j.store.query.eval.AbstractExpressionEvaluator<DyadicExpression>
      extended by org.cumulus4j.store.query.eval.OrExpressionEvaluator

public class OrExpressionEvaluator
extends AbstractExpressionEvaluator<DyadicExpression>

Evaluator handling the boolean operation "||" (OR).

This evaluator works just like the AndExpressionEvaluator with the only difference that it unites the partial results instead of intersecting them.

If the ResultDescriptor indicates a negation, this evaluator delegates to the AndExpressionEvaluator, because a query like "!( a > 5 || b <= 12 )" is internally converted to "a <= 5 && b > 12" for performance reasons. See NotExpressionEvaluator as well as De Morgan's laws in wikipedia for details.

Author:
Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de
See Also:
AndExpressionEvaluator

Constructor Summary
OrExpressionEvaluator(AndExpressionEvaluator negatedExpressionEvaluator)
           
OrExpressionEvaluator(QueryEvaluator queryEvaluator, AbstractExpressionEvaluator<?> parent, DyadicExpression expression)
           
 
Method Summary
protected  Set<Long> _queryResultDataEntryIDs(ResultDescriptor resultDescriptor)
          Execute a query for the given resultDescriptor.
protected  Set<Long> _queryResultDataEntryIDsIgnoringNegation(ResultDescriptor resultDescriptor)
           
 AbstractExpressionEvaluator<? extends Expression> getLeft()
          Get the left branch in the tree structure.
 AbstractExpressionEvaluator<? extends Expression> getRight()
          Get the right branch in the tree structure.
 
Methods inherited from class org.cumulus4j.store.query.eval.AbstractExpressionEvaluator
_getResultSymbols, _queryResultObjects, getExpression, getFieldType, getParent, getQueryEvaluator, getResultSymbols, queryResultDataEntryIDs, queryResultObjects, setLeft, setRight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrExpressionEvaluator

public OrExpressionEvaluator(QueryEvaluator queryEvaluator,
                             AbstractExpressionEvaluator<?> parent,
                             DyadicExpression expression)

OrExpressionEvaluator

public OrExpressionEvaluator(AndExpressionEvaluator negatedExpressionEvaluator)
Method Detail

getLeft

public AbstractExpressionEvaluator<? extends Expression> getLeft()
Description copied from class: AbstractExpressionEvaluator
Get the left branch in the tree structure.

Overrides:
getLeft in class AbstractExpressionEvaluator<DyadicExpression>
Returns:
the left branch in the tree structure or null if there is none.
See Also:
AbstractExpressionEvaluator.setLeft(AbstractExpressionEvaluator), AbstractExpressionEvaluator.getRight()

getRight

public AbstractExpressionEvaluator<? extends Expression> getRight()
Description copied from class: AbstractExpressionEvaluator
Get the right branch in the tree structure.

Overrides:
getRight in class AbstractExpressionEvaluator<DyadicExpression>
Returns:
the right branch in the tree structure or null if there is none.
See Also:
AbstractExpressionEvaluator.setRight(AbstractExpressionEvaluator), AbstractExpressionEvaluator.getLeft()

_queryResultDataEntryIDs

protected Set<Long> _queryResultDataEntryIDs(ResultDescriptor resultDescriptor)
Description copied from class: AbstractExpressionEvaluator
Execute a query for the given resultDescriptor. This method should contain the concrete logic for AbstractExpressionEvaluator.queryResultDataEntryIDs(ResultDescriptor) and must be implemented by subclasses.

Specified by:
_queryResultDataEntryIDs in class AbstractExpressionEvaluator<DyadicExpression>
Parameters:
resultDescriptor - the descriptor specifying what candidates (usually "this" or a variable) the caller is interested in as well as modifiers (e.g. negation) affecting the query.
Returns:
those dataEntryIDs that match the query criteria for the specified resultSymbol or null, if the symbol is not supported (this should be consistent with the implementation of AbstractExpressionEvaluator._getResultSymbols()).
See Also:
AbstractExpressionEvaluator.queryResultDataEntryIDs(ResultDescriptor)

_queryResultDataEntryIDsIgnoringNegation

protected Set<Long> _queryResultDataEntryIDsIgnoringNegation(ResultDescriptor resultDescriptor)

Cumulus4j API
(1.0.0)

Copyright © 2012 NightLabs Consulting GmbH. All Rights Reserved.