Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/importer/ValueKey.java @ 501:04d449f7f0c9
Importer: Change caching strategy not to cause OOM any more.
flys-backend/trunk@1855 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 09 May 2011 00:15:45 +0000 |
parents | |
children | bcc18293a547 |
comparison
equal
deleted
inserted
replaced
500:d50cd3a632e0 | 501:04d449f7f0c9 |
---|---|
1 package de.intevation.flys.importer; | |
2 | |
3 import java.math.BigDecimal; | |
4 | |
5 public class ValueKey | |
6 { | |
7 protected BigDecimal a; | |
8 protected BigDecimal b; | |
9 | |
10 public ValueKey() { | |
11 } | |
12 | |
13 public ValueKey(BigDecimal a, BigDecimal b) { | |
14 this.a = a; | |
15 this.b = b; | |
16 } | |
17 | |
18 @Override | |
19 public int hashCode() { | |
20 return ((a != null ? a.hashCode() : 0) << 16) | |
21 | (b != null ? b.hashCode() : 0); | |
22 } | |
23 | |
24 @Override | |
25 public boolean equals(Object other) { | |
26 if (!(other instanceof ValueKey)) { | |
27 return false; | |
28 } | |
29 ValueKey o = (ValueKey)other; | |
30 return !( | |
31 (a == null && o.a != null) | |
32 || (a != null && o.a == null) | |
33 || (a != null && !a.equals(o.a)) | |
34 || (b == null && o.b != null) | |
35 || (b != null && o.b == null) | |
36 || (b != null && !b.equals(o.b))); | |
37 } | |
38 } | |
39 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |