annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/StaticSedimentLoadCacheKey.java @ 4351:cb1655e87ce6

Doc.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 01 Nov 2012 12:30:07 +0100
parents 3051bc28ac43
children 6a65e7ef43c0
rev   line source
4296
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.model;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
2
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
3 import java.util.Date;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
4
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
5 import org.apache.commons.lang.builder.HashCodeBuilder;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
6
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
7
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
8 public class StaticSedimentLoadCacheKey
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
9 {
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10 public static final String CACHE_NAME = "sedimentload-value-table-static";
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
11
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
12 private String river;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
13 private double startKm;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
14 private double endKm;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
15 private Date date;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
16
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
17 public StaticSedimentLoadCacheKey(
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
18 String river,
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
19 double startKm,
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
20 double endKm,
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21 Date date
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
22 ) {
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
23 this.river = river;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
24 this.startKm = startKm;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
25 this.endKm = endKm;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
26 this.date = date;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
27 }
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
28
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
29 public int hashCode() {
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
30 HashCodeBuilder builder = new HashCodeBuilder();
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
31 builder.append(river);
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
32 builder.append(startKm);
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
33 builder.append(endKm);
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
34 builder.append(date);
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
35 return builder.toHashCode();
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
36 }
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
37
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
38 public boolean equals(Object other) {
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
39 if (!(other instanceof StaticBedHeightCacheKey)) {
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
40 return false;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
41 }
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
42 StaticSedimentLoadCacheKey o = (StaticSedimentLoadCacheKey) other;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
43 return this.river == o.river &&
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
44 this.startKm == o.startKm &&
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
45 this.endKm == o.endKm &&
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
46 this.date == o.date;
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
47 }
3051bc28ac43 Added data object and factory for sediment load calculation.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
48 }

http://dive4elements.wald.intevation.org