Mercurial > dive4elements > river
changeset 8662:c9b8ad659d5b
Use EpsilonComparator instead of redundant implementation.
author | "Tom Gottfried <tom@intevation.de>" |
---|---|
date | Tue, 07 Apr 2015 11:20:36 +0200 |
parents | befa08182368 |
children | b78ca00d4659 |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java |
diffstat | 1 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java Thu Apr 02 18:37:26 2015 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java Tue Apr 07 11:20:36 2015 +0200 @@ -31,6 +31,8 @@ import gnu.trove.TDoubleArrayList; +import static org.dive4elements.river.backend.utils.EpsilonComparator.CMP; + /** * W, Q and km data from database 'wsts' spiced with interpolation algorithms. */ @@ -201,10 +203,7 @@ * Compare according to place of measurement (km). */ public int compareTo(Row other) { - double d = km - other.km; - if (d < -0.0001) return -1; - if (d > 0.0001) return +1; - return 0; + return CMP.compare(km, other.km); } /**