org.neodatis.odb.core.query.criteria
Class AbstractCriterion

java.lang.Object
  extended by org.neodatis.odb.core.query.criteria.AbstractCriterion
All Implemented Interfaces:
java.io.Serializable, ICriterion
Direct Known Subclasses:
CollectionSizeCriterion, ComparisonCriterion, ContainsCriterion, EqualCriterion, IsNotNullCriterion, IsNullCriterion, LikeCriterion

public abstract class AbstractCriterion
extends java.lang.Object
implements ICriterion

An adapter for Criterion.

Author:
olivier s
See Also:
Serialized Form

Field Summary
protected  java.lang.String attributeName
          The name of the attribute involved by this criterion
 
Constructor Summary
AbstractCriterion(java.lang.String fieldName)
           
 
Method Summary
 IExpression and(ICriterion criterion)
           
 boolean canUseIndex()
           
 IOdbList<java.lang.String> getAllInvolvedFields()
          An abstract criterion only restrict one field => it returns a list of one field!
 java.lang.String getAttributeName()
           
 IQuery getQuery()
          Gets thes whole query
 boolean match(AbstractObjectInfo aoi)
           
 boolean match(AttributeValuesMap attributeValues)
           
abstract  boolean match(java.lang.Object valueToMatch)
          To check if an object matches this criterion
 IExpression not()
           
 IExpression or(ICriterion criterion)
           
 void setAttributeName(java.lang.String attributeName)
           
 void setQuery(IQuery query)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.neodatis.odb.core.query.criteria.ICriterion
getValues, ready
 

Field Detail

attributeName

protected java.lang.String attributeName
The name of the attribute involved by this criterion

Constructor Detail

AbstractCriterion

public AbstractCriterion(java.lang.String fieldName)
Method Detail

canUseIndex

public boolean canUseIndex()
Specified by:
canUseIndex in interface ICriterion

match

public boolean match(AbstractObjectInfo aoi)

match

public boolean match(AttributeValuesMap attributeValues)

match

public abstract boolean match(java.lang.Object valueToMatch)
Description copied from interface: ICriterion
To check if an object matches this criterion

Specified by:
match in interface ICriterion
Returns:
true if object matches the criteria TODO create a math(AttributeValuesMap)

and

public IExpression and(ICriterion criterion)

or

public IExpression or(ICriterion criterion)

not

public IExpression not()

getQuery

public IQuery getQuery()
Gets thes whole query

Specified by:
getQuery in interface ICriterion
Returns:
The owner query

setQuery

public void setQuery(IQuery query)
Specified by:
setQuery in interface ICriterion

getAttributeName

public java.lang.String getAttributeName()
Returns:
The attribute involved in the criterion

getAllInvolvedFields

public IOdbList<java.lang.String> getAllInvolvedFields()
An abstract criterion only restrict one field => it returns a list of one field!

Specified by:
getAllInvolvedFields in interface ICriterion
Returns:
The list of involved field of the criteria

setAttributeName

public void setAttributeName(java.lang.String attributeName)