Interface Comparison
public interface Comparison
A Comparison represents and arbitrary comparison of two
Numerals. Has default implementations of
greaterThan(), greaterOrEqual(), lesserThan(), lesserOrEqual(), equal()
and strictEqual().-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic Comparisonequal()static Comparisonstatic Comparisonstatic Comparisonstatic Comparisonpredicate(ComparisonContext context, Numeral other) static Comparison
-
Method Details
-
compare
-
greaterThan
- Returns:
- comparison that returns
trueif the firstNumeralis greater than the second Numeral
-
greaterOrEqual
- Returns:
- comparison that returns
trueif the firstNumeralis greater than or equal to the second Numeral
-
lesserThan
- Returns:
- comparison that returns
trueif the firstNumeralis lesser than the second Numeral
-
lesserOrEqual
- Returns:
- comparison that returns
trueif the firstNumeralis lesser than or equal to the second Numeral
-
equal
- Returns:
- comparison that returns
trueif the firstNumeralis equal to the second Numeral
-
strictEqual
- Returns:
- comparison that returns
trueif the firstNumeralis strictly equal to the second Numeral. That is, the Numerals do not only represent the same number, but are also of the sameNumeralType
-
predicate
-
predicate
- Parameters:
context-ComparisonContextfor this comparisonother- secondNumeralto be compared- Returns:
PredicateforValuethat returns the result of this comparison against a second Numeral with the specifiedComparisonContext
-