org.kuali.rice.krms.framework.engine.expression
Class DefaultComparisonOperator
java.lang.Object
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)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultComparisonOperator
public DefaultComparisonOperator()
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 tovalue
- 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.