diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/map/StaticHWSCacheKey.java	Thu Mar 14 17:13:49 2013 +0100
@@ -0,0 +1,27 @@
+package de.intevation.flys.artifacts.model.map;
+
+
+public class StaticHWSCacheKey
+{
+    public static final String CACHE_NAME = "hws-value-table-static";
+
+    private String river;
+    private int type;
+    
+    public StaticHWSCacheKey(String river, int type) {
+        this.river = river;
+        this.type = type;
+    }
+
+    public int hashCode() {
+        return river.hashCode() | (type << 8);
+    }
+
+    public boolean equals(Object other) {
+        if (!(other instanceof StaticHWSCacheKey)) {
+            return false;
+        }
+        StaticHWSCacheKey o = (StaticHWSCacheKey) other;
+        return this.river == o.river;
+    }
+}

http://dive4elements.wald.intevation.org