Package com.singularsys.extensions.field
Class AbstractComparativeField
java.lang.Object
com.singularsys.extensions.field.AbstractComparativeField
- All Implemented Interfaces:
FieldI,Serializable
- Direct Known Subclasses:
ComplexFieldWithTotalOrder,ExtDocsTest.StringField2,GenericField,StringField
An abstract base class for fields where comparison methods are implemented using a single
cmp(a,b) method.
Subclasses just need to implement a single method and not the full set of comparison methods.
Not all types want to extend this class, for instance with doubles it fails to work with NaN values.
Since Jep 4.1 extensions 2.2 this has been moved to
the com.singularsys.extensions.field.implementations package from the
the com.singularsys.extensions.field package.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract IntegerCompare two elements, return -1,0,1 if the comparison can be carried out, null otherwise.EqualsGreater or equal toGreater thanLess than or equals toLess thanNot Equals
-
Constructor Details
-
AbstractComparativeField
public AbstractComparativeField()
-
-
Method Details
-
cmp
Compare two elements, return -1,0,1 if the comparison can be carried out, null otherwise.- Parameters:
l-r-- Returns:
- -1, 0, 1 if l < r, l==r or l > r respectively, or null if comparison cannot be carried out or
- Throws:
EvaluationException
-
eq
Description copied from interface:FieldIEquals- Specified by:
eqin interfaceFieldI- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
ne
Description copied from interface:FieldINot Equals- Specified by:
nein interfaceFieldI- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
gt
Description copied from interface:FieldIGreater than- Specified by:
gtin interfaceFieldI- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
ge
Description copied from interface:FieldIGreater or equal to- Specified by:
gein interfaceFieldI- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
lt
Description copied from interface:FieldILess than- Specified by:
ltin interfaceFieldI- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-
le
Description copied from interface:FieldILess than or equals to- Specified by:
lein interfaceFieldI- Parameters:
l- left-hand argumentr- right-hand argument- Returns:
- an object representing the result or null if it can not be evaluated.
- Throws:
EvaluationException- on error
-