# HG changeset patch # User Andre Heinecke # Date 1387194076 -3600 # Node ID 622c89640048edc5328c06303cd64a9391bb4bde # Parent c130196389dfa98d35273db78bead6ac0bf90272 Add Override marker and fix indention diff -r c130196389df -r 622c89640048 artifacts/src/main/java/org/dive4elements/river/artifacts/model/MiddleBedHeightData.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MiddleBedHeightData.java Mon Dec 16 12:26:52 2013 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MiddleBedHeightData.java Mon Dec 16 12:41:16 2013 +0100 @@ -191,30 +191,31 @@ } } - public int compareTo(MiddleBedHeightData other) { - - int descCompared = description.compareTo(other.getDescription()); - - if (descCompared != 0) { - return descCompared; - } + @Override + public int compareTo(MiddleBedHeightData other) { - if (size() == 0 || other.size() == 0) { - if (size() == 0 && other.size() > 0) { - return 1; - } else if (size() > 0 && other.size() == 0) { - return -1; - } else if (size() == 0 && other.size() == 0) { - return 0; - } - } + int descCompared = description.compareTo(other.getDescription()); - if (getKM(0) < other.getKM(0)) { - return -1; - } else if (getKM(0) > other.getKM(0)) { - return 1; - } - return 0; - } + if (descCompared != 0) { + return descCompared; + } + + if (size() == 0 || other.size() == 0) { + if (size() == 0 && other.size() > 0) { + return 1; + } else if (size() > 0 && other.size() == 0) { + return -1; + } else if (size() == 0 && other.size() == 0) { + return 0; + } + } + + if (getKM(0) < other.getKM(0)) { + return -1; + } else if (getKM(0) > other.getKM(0)) { + return 1; + } + return 0; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :