= OrderRelation
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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

[source,java]
.OrderRelation.java
----
interface OrderRelation<T, D> {
  D epsilon()     // <.>
  int compare(T a, T b, D epsilon)     // <.>
  int compare(T a, T b)
  boolean equals(T a, T b, D epsilon)     // <.>
  boolean equals(T a, T b)
}
----

<.> xref:#epsilon_[epsilon()]
+
--
Default epsilon (measure of accuracy).
--
<.> xref:#compare_T_T_D[compare(T, T, D)]
<.> xref:#equals_T_T_D[equals(T, T, D)]

== Members

[#epsilon_]
=== epsilon()

Default epsilon (measure of accuracy).

[#compare_T_T_D]
=== compare(T, T, D)

[#equals_T_T_D]
=== equals(T, T, D)
