Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/StaticSedimentLoadCacheKey.java @ 5838:5aa05a7a34b7
Rename modules to more fitting names.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 15:23:37 +0200 |
parents | flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/StaticSedimentLoadCacheKey.java@bd047b71ab37 |
children | 4897a58c8746 |
comparison
equal
deleted
inserted
replaced
5837:d9901a08d0a6 | 5838:5aa05a7a34b7 |
---|---|
1 package org.dive4elements.river.artifacts.model; | |
2 | |
3 import org.apache.commons.lang.builder.HashCodeBuilder; | |
4 | |
5 | |
6 public class StaticSedimentLoadCacheKey | |
7 { | |
8 public static final String CACHE_NAME = "sedimentload-value-table-static"; | |
9 | |
10 private String river; | |
11 private double startKm; | |
12 private double endKm; | |
13 private int sYear; | |
14 private int eYear; | |
15 | |
16 public StaticSedimentLoadCacheKey( | |
17 String river, | |
18 double startKm, | |
19 double endKm, | |
20 int sYear, | |
21 int eYear | |
22 ) { | |
23 this.river = river; | |
24 this.startKm = startKm; | |
25 this.endKm = endKm; | |
26 this.sYear = sYear; | |
27 this.eYear = eYear; | |
28 } | |
29 | |
30 @Override | |
31 public int hashCode() { | |
32 HashCodeBuilder builder = new HashCodeBuilder(); | |
33 builder.append(river); | |
34 builder.append(startKm); | |
35 builder.append(endKm); | |
36 builder.append(sYear); | |
37 builder.append(eYear); | |
38 return builder.toHashCode(); | |
39 } | |
40 | |
41 @Override | |
42 public boolean equals(Object other) { | |
43 if (!(other instanceof StaticBedHeightCacheKey)) { | |
44 return false; | |
45 } | |
46 StaticSedimentLoadCacheKey o = (StaticSedimentLoadCacheKey) other; | |
47 return this.river == o.river && | |
48 this.startKm == o.startKm && | |
49 this.endKm == o.endKm && | |
50 this.sYear == o.sYear && | |
51 this.eYear == o.eYear; | |
52 } | |
53 } |