org.kuali.rice.krms.framework.engine.expression
Class DefaultComparisonOperator

java.lang.Object
  extended by org.kuali.rice.krms.framework.engine.expression.DefaultComparisonOperator
All Implemented Interfaces:
Comparator, EngineComparatorExtension, StringCoercionExtension

public class DefaultComparisonOperator
extends Object
implements EngineComparatorExtension, StringCoercionExtension

The default ComparisonOperator. If no other EngineComparatorExtension have been configured to handle a type, the DefaultComparisonOperator will be used. At the moment the DefaultComparisonOperator is also the default StringCoercionExtension for coercing types.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
DefaultComparisonOperator()
           
 
Method Summary
 boolean canCoerce(String type, String value)
          Can this StringCoercionExtension coerce the given type and value into an Object?
 boolean canCompare(Object lhs, Object rhs)
           
 Object coerce(String type, String value)
          Returns an Object of the given type populated with the given value.
 int compare(Object lhs, Object rhs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

DefaultComparisonOperator

public DefaultComparisonOperator()
Method Detail

compare

public int compare(Object lhs,
                   Object rhs)
Specified by:
compare in interface Comparator
Specified by:
compare in interface EngineComparatorExtension
Returns:
int where 0 is equals - is less than and + is greater than

canCompare

public boolean canCompare(Object lhs,
                          Object rhs)
Specified by:
canCompare in interface EngineComparatorExtension
Returns:
able to compare lhs and rhs

coerce

public Object coerce(String type,
                     String value)
Description copied from interface: StringCoercionExtension
Returns an Object of the given type populated with the given value.

Specified by:
coerce in interface StringCoercionExtension
Parameters:
type - to coerce Object to
value - to coerce
Returns:
Object of given type with given value

canCoerce

public boolean canCoerce(String type,
                         String value)
Description copied from interface: StringCoercionExtension
Can this StringCoercionExtension coerce the given type and value into an Object?

Specified by:
canCoerce in interface StringCoercionExtension
Parameters:
type - of Object to coerce to.
value - value to use for coerced type
Returns:
boolean true if this StringCoercionExtension can coerce this type and value


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.