org.deegree.filter.comparison
Class ComparisonOperator

java.lang.Object
  extended by org.deegree.filter.comparison.ComparisonOperator
All Implemented Interfaces:
Operator
Direct Known Subclasses:
BinaryComparisonOperator, PropertyIsBetween, PropertyIsLike, PropertyIsNil, PropertyIsNull

public abstract class ComparisonOperator
extends Object
implements Operator

Abstract base class for all comparison operators.

Version:
$Revision:$, $Date:$
Author:
Markus Schneider , last edited by: $Author:$

Nested Class Summary
static class ComparisonOperator.SubType
           
 
Nested classes/interfaces inherited from interface org.deegree.filter.Operator
Operator.Type
 
Field Summary
protected  MatchAction matchAction
           
protected  Boolean matchCase
           
 
Constructor Summary
protected ComparisonOperator(Boolean matchCase, MatchAction matchAction)
           
 
Method Summary
protected  Comparable<?> checkComparableOrNull(Object value)
          Performs a checked cast to Comparable.
 MatchAction getMatchAction()
           
abstract  Expression[] getParams()
           
protected  Pair<PrimitiveValue,PrimitiveValue> getPrimitiveValues(TypedObjectNode value1, TypedObjectNode value2)
          Creates a pair of PrimitiveValue instances from the given TypedObjectNode while trying to preserve primitive type information.
abstract  ComparisonOperator.SubType getSubType()
           
 Operator.Type getType()
          Returns the type of operator.
 Boolean isMatchCase()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.deegree.filter.Operator
evaluate, toString
 

Field Detail

matchCase

protected final Boolean matchCase

matchAction

protected final MatchAction matchAction
Constructor Detail

ComparisonOperator

protected ComparisonOperator(Boolean matchCase,
                             MatchAction matchAction)
Method Detail

getType

public Operator.Type getType()
Description copied from interface: Operator
Returns the type of operator. Use this to safely determine the subtype of Operator.

Specified by:
getType in interface Operator
Returns:
type of operator

isMatchCase

public Boolean isMatchCase()

getMatchAction

public MatchAction getMatchAction()

getSubType

public abstract ComparisonOperator.SubType getSubType()

checkComparableOrNull

protected Comparable<?> checkComparableOrNull(Object value)
                                       throws FilterEvaluationException
Performs a checked cast to Comparable. If the given value is neither null nor a Comparable instance, a corresponding FilterEvaluationException is thrown.

Parameters:
value -
Returns:
the very same value (if it is a Comparable or null)
Throws:
FilterEvaluationException - if the value is neither null nor a Comparable

getPrimitiveValues

protected Pair<PrimitiveValue,PrimitiveValue> getPrimitiveValues(TypedObjectNode value1,
                                                                 TypedObjectNode value2)
                                                          throws FilterEvaluationException
Creates a pair of PrimitiveValue instances from the given TypedObjectNode while trying to preserve primitive type information.

Parameters:
value1 -
value2 -
Throws:
FilterEvaluationException

getParams

public abstract Expression[] getParams()


Copyright © 2011. All Rights Reserved.