Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/Range.java @ 6378:2ad7f3ada1dc
Artifacts: instanceof null == false, so extra null check needed.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 20 Jun 2013 17:55:18 +0200 |
parents | 01073acf6735 |
children | dc23ffb9d82c |
comparison
equal
deleted
inserted
replaced
6377:fa8425c8694c | 6378:2ad7f3ada1dc |
---|---|
76 new Double(this.end).hashCode(); | 76 new Double(this.end).hashCode(); |
77 } | 77 } |
78 | 78 |
79 @Override | 79 @Override |
80 public boolean equals(Object otherRange) { | 80 public boolean equals(Object otherRange) { |
81 if (otherRange == null) { | 81 if (otherRange instanceof Range) { |
82 return false; | |
83 } | |
84 else if (otherRange instanceof Range) { | |
85 Range oRange = (Range) otherRange; | 82 Range oRange = (Range) otherRange; |
86 return | 83 return |
87 Math.abs(oRange.start - this.start) <= EPSILON | 84 Math.abs(oRange.start - this.start) <= EPSILON |
88 && Math.abs(oRange.end - this.end) <= EPSILON; | 85 && Math.abs(oRange.end - this.end) <= EPSILON; |
89 } | 86 } |