OrderRelation

Provides an ordering relation for a given value-type.

Does supports an epsilon parameter (measure of accuracy), which has different meaning, depending on context

  • Numbers: accuracy is usually given as number eg. 1E-12 - in case of integers should default to 0

  • Dates (temporal): accuracy is usually given as a number of days - should default to 0

  • Times (temporal): accuracy is usually given as a number of seconds - eg. 1E-3 for millisecond resolution

API

OrderRelation.java
interface OrderRelation<T, D> {
  D epsilon()     (1)
  int compare(T a, T b, D epsilon)     (2)
  int compare(T a, T b)
  boolean equals(T a, T b, D epsilon)     (3)
  boolean equals(T a, T b)
}
1 epsilon()

Default epsilon (measure of accuracy).

2 compare(T, T, D)
3 equals(T, T, D)

Members

epsilon()

Default epsilon (measure of accuracy).

compare(T, T, D)

equals(T, T, D)