org.qi4j.api.query.grammar
Class ComparisonSpecification<T>

java.lang.Object
  extended by org.qi4j.api.query.grammar.ExpressionSpecification
      extended by org.qi4j.api.query.grammar.ComparisonSpecification<T>
All Implemented Interfaces:
Specification<Composite>
Direct Known Subclasses:
EqSpecification, GeSpecification, GtSpecification, LeSpecification, LtSpecification, NeSpecification

public abstract class ComparisonSpecification<T>
extends ExpressionSpecification

Base comparison Specification.


Field Summary
protected  PropertyFunction<T> property
           
protected  T value
           
 
Constructor Summary
ComparisonSpecification(PropertyFunction<T> property, T value)
           
 
Method Summary
protected abstract  boolean compare(T value)
           
 PropertyFunction<T> property()
           
 boolean satisfiedBy(Composite item)
          Test whether an item matches the given specification
 T value()
           
 
Methods inherited from class org.qi4j.api.query.grammar.ExpressionSpecification
and, or
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

property

protected final PropertyFunction<T> property

value

protected final T value
Constructor Detail

ComparisonSpecification

public ComparisonSpecification(PropertyFunction<T> property,
                               T value)
Method Detail

property

public PropertyFunction<T> property()

satisfiedBy

public final boolean satisfiedBy(Composite item)
Description copied from interface: Specification
Test whether an item matches the given specification

Parameters:
item - the item to be tested
Returns:
true if the item matches, false otherwise

compare

protected abstract boolean compare(T value)

value

public T value()