org.ujorm.criterion
Class ValueCriterion<UJO extends Ujo>

java.lang.Object
  extended by org.ujorm.criterion.Criterion<UJO>
      extended by org.ujorm.criterion.ValueCriterion<UJO>

public class ValueCriterion<UJO extends Ujo>
extends Criterion<UJO>

The value criterion implementation.

Since:
0.90
Author:
Pavel Ponec

Field Summary
static Criterion<Ujo> FALSE
          False constant criterion
static Criterion<Ujo> TRUE
          True constant criterion
protected  java.lang.Object value
           
 
Constructor Summary
ValueCriterion(boolean value)
          Creante an Criterion constant
ValueCriterion(UjoProperty<UJO,? extends java.lang.Object> property, Operator operator, java.lang.Object value)
          An undefined operator (null) is replaced by EQ.
ValueCriterion(UjoProperty<UJO,? extends java.lang.Object> property, Operator operator, UjoProperty<UJO,java.lang.Object> value)
          An undefined operator (null) is replaced by EQ.
 
Method Summary
protected  int compare(java.lang.Comparable o1, java.lang.Comparable o2)
          Compare two object
 boolean evaluate(UJO ujo)
          Apply the criterion to the UJO object
 UjoProperty getLeftNode()
          Returns the left node of the parrent
 Operator getOperator()
          Returns an operator
 java.lang.Object getRightNode()
          Returns the right node of the parrent
 boolean isConstant()
          Is the operator have got value XFIXED or XSQL ?
 boolean isInsensitive()
          Is the operator insensitive.
protected  void makeArrayTest(java.lang.Object value)
          Test a value is an instance of Iterable.
protected  void makeCharSequenceTest(java.lang.Object value)
          Test a value is an instance of CharSequence or a type UjoProperty is type of CharSequence.
protected  void printValue(java.lang.Object value, java.lang.StringBuilder out)
          Print an Ujo value
 java.lang.String toString()
           
 
Methods inherited from class org.ujorm.criterion.Criterion
and, constant, evaluate, evaluate, forAll, forNone, forSql, isBinary, join, newInstance, newInstance, newInstance, newInstance, not, or, where, where, where, where, where, whereIn, whereIn, whereNotIn, whereNotIn, whereNotNull, whereNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static final Criterion<Ujo> TRUE
True constant criterion


FALSE

public static final Criterion<Ujo> FALSE
False constant criterion


value

protected final java.lang.Object value
Constructor Detail

ValueCriterion

public ValueCriterion(boolean value)
Creante an Criterion constant


ValueCriterion

public ValueCriterion(UjoProperty<UJO,? extends java.lang.Object> property,
                      Operator operator,
                      UjoProperty<UJO,java.lang.Object> value)
An undefined operator (null) is replaced by EQ.


ValueCriterion

public ValueCriterion(UjoProperty<UJO,? extends java.lang.Object> property,
                      Operator operator,
                      java.lang.Object value)
An undefined operator (null) is replaced by EQ.

Method Detail

getLeftNode

public final UjoProperty getLeftNode()
Returns the left node of the parrent

Specified by:
getLeftNode in class Criterion<UJO extends Ujo>

getRightNode

public final java.lang.Object getRightNode()
Returns the right node of the parrent

Specified by:
getRightNode in class Criterion<UJO extends Ujo>

getOperator

public final Operator getOperator()
Returns an operator

Specified by:
getOperator in class Criterion<UJO extends Ujo>

evaluate

public boolean evaluate(UJO ujo)
Description copied from class: Criterion
Apply the criterion to the UJO object

Specified by:
evaluate in class Criterion<UJO extends Ujo>
Returns:
Returns the value true in case the ujo object satisfies the condition.

makeCharSequenceTest

protected final void makeCharSequenceTest(java.lang.Object value)
                                   throws java.lang.IllegalArgumentException
Test a value is an instance of CharSequence or a type UjoProperty is type of CharSequence. If parameter is not valid than method throws Exception.

Throws:
java.lang.IllegalArgumentException

makeArrayTest

protected final void makeArrayTest(java.lang.Object value)
                            throws java.lang.IllegalArgumentException
Test a value is an instance of Iterable. If parameter is not valid than method throws Exception.

Throws:
java.lang.IllegalArgumentException

compare

protected int compare(java.lang.Comparable o1,
                      java.lang.Comparable o2)
Compare two object


isInsensitive

public boolean isInsensitive()
Is the operator insensitive.


isConstant

public final boolean isConstant()
Is the operator have got value XFIXED or XSQL ?


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

printValue

protected void printValue(java.lang.Object value,
                          java.lang.StringBuilder out)
Print an Ujo value

Parameters:
value - Not null value


Copyright © 2007-2012 PPonec