comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/map/StaticHWSCacheKey.java @ 5307:6131b352e5e4

Data structure and factory for hws.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 14 Mar 2013 17:13:49 +0100
parents
children ac2746f3e75f
comparison
equal deleted inserted replaced
5306:cd8b84af2ebc 5307:6131b352e5e4
1 package de.intevation.flys.artifacts.model.map;
2
3
4 public class StaticHWSCacheKey
5 {
6 public static final String CACHE_NAME = "hws-value-table-static";
7
8 private String river;
9 private int type;
10
11 public StaticHWSCacheKey(String river, int type) {
12 this.river = river;
13 this.type = type;
14 }
15
16 public int hashCode() {
17 return river.hashCode() | (type << 8);
18 }
19
20 public boolean equals(Object other) {
21 if (!(other instanceof StaticHWSCacheKey)) {
22 return false;
23 }
24 StaticHWSCacheKey o = (StaticHWSCacheKey) other;
25 return this.river == o.river;
26 }
27 }

http://dive4elements.wald.intevation.org