comparison flys-backend/src/main/java/de/intevation/flys/utils/EpsilonComparator.java @ 4742:ce6b9945bf8e

Doc.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 28 Dec 2012 15:03:55 +0100
parents flys-backend/src/main/java/de/intevation/flys/importer/parsers/tim/EpsilonComparator.java@7fdddc6ba296
children
comparison
equal deleted inserted replaced
4741:f6d0ad25f1ee 4742:ce6b9945bf8e
1 package de.intevation.flys.utils; 1 package de.intevation.flys.utils;
2 2
3 import java.util.Comparator; 3 import java.util.Comparator;
4 4
5 /** Comparator with some tolerance (epsilon). */
5 public class EpsilonComparator implements Comparator<Double> 6 public class EpsilonComparator implements Comparator<Double>
6 { 7 {
7 public static final double EPSILON = 1e-4; 8 public static final double EPSILON = 1e-4;
8 9
10 /** Ready-made comparator with 1e-4 tolerance. */
9 public static final EpsilonComparator CMP = new EpsilonComparator(EPSILON); 11 public static final EpsilonComparator CMP = new EpsilonComparator(EPSILON);
10 12
11 private double epsilon; 13 private double epsilon;
12 14
13 public EpsilonComparator(double epsilon) { 15 public EpsilonComparator(double epsilon) {

http://dive4elements.wald.intevation.org