Package org.faktorips.fl.operations
Class CompareToComparableDatatype
java.lang.Object
org.faktorips.fl.operations.AbstractBinaryOperation<org.faktorips.codegen.JavaCodeFragment>
org.faktorips.fl.operations.AbstractBinaryJavaOperation
org.faktorips.fl.operations.CompareToComparableDatatype
- All Implemented Interfaces:
BinaryOperation<org.faktorips.codegen.JavaCodeFragment>
This is a generic operation for comparable datatypes to. It allows to use greater than, greater
or equal, less than and less or equal, according to the operator. Important for this generic
operation is, that the given operator is the same as it is used in java code! It is simply
transformed to be used with the
Comparable.compareTo(Object) method comparing zero.
Example:
For the operator '<' we simply generate (lhs.compareTo(rhs) < 0)'
-
Field Summary
Fields inherited from interface org.faktorips.fl.BinaryOperation
DIVIDE, EQUAL, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESSER_THAN, LESSER_THAN_OR_EQUAL, MINUS, MULTIPLY, NOT_EQUAL, PLUS -
Constructor Summary
ConstructorsConstructorDescriptionCompareToComparableDatatype(String operator, org.faktorips.datatype.Datatype type) -
Method Summary
Modifier and TypeMethodDescriptionOverridden method.Methods inherited from class org.faktorips.fl.operations.AbstractBinaryJavaOperation
generateMethods inherited from class org.faktorips.fl.operations.AbstractBinaryOperation
getCompiler, getLhsDatatype, getOperator, getRhsDatatype, setCompiler
-
Constructor Details
-
CompareToComparableDatatype
-
-
Method Details
-
generate
Overridden method.- Specified by:
generatein classAbstractBinaryJavaOperation- Parameters:
lhs- the left hand side operandrhs- the right hand side operand- Returns:
- the given operands combined with this operation's operator
- See Also:
-