comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/StaticSedimentLoadCacheKey.java @ 4296:3051bc28ac43

Added data object and factory for sediment load calculation. The factory provides two methods to get sediment load data: The first is to get an array of loads for a specific range at a river, these loads contain the time and description. The second is to get a single sediment load with time, description and data values.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 29 Oct 2012 12:14:50 +0100
parents
children 6a65e7ef43c0
comparison
equal deleted inserted replaced
4295:2a64d42a75e6 4296:3051bc28ac43
1 package de.intevation.flys.artifacts.model;
2
3 import java.util.Date;
4
5 import org.apache.commons.lang.builder.HashCodeBuilder;
6
7
8 public class StaticSedimentLoadCacheKey
9 {
10 public static final String CACHE_NAME = "sedimentload-value-table-static";
11
12 private String river;
13 private double startKm;
14 private double endKm;
15 private Date date;
16
17 public StaticSedimentLoadCacheKey(
18 String river,
19 double startKm,
20 double endKm,
21 Date date
22 ) {
23 this.river = river;
24 this.startKm = startKm;
25 this.endKm = endKm;
26 this.date = date;
27 }
28
29 public int hashCode() {
30 HashCodeBuilder builder = new HashCodeBuilder();
31 builder.append(river);
32 builder.append(startKm);
33 builder.append(endKm);
34 builder.append(date);
35 return builder.toHashCode();
36 }
37
38 public boolean equals(Object other) {
39 if (!(other instanceof StaticBedHeightCacheKey)) {
40 return false;
41 }
42 StaticSedimentLoadCacheKey o = (StaticSedimentLoadCacheKey) other;
43 return this.river == o.river &&
44 this.startKm == o.startKm &&
45 this.endKm == o.endKm &&
46 this.date == o.date;
47 }
48 }

http://dive4elements.wald.intevation.org