annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTableCacheKey.java @ 1005:52949da92f7a

The signature of BackendListener in artifactdatabase has changed. flys-artifacts/trunk@2446 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 02 Aug 2011 11:20:18 +0000
parents 07640ab913fd
children 305a338c43c2
rev   line source
626
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.model;
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
3 import java.io.Serializable;
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
4
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
5 public final class WstValueTableCacheKey
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
6 implements Serializable
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
7 {
632
07640ab913fd First part of storing qs in ranges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 626
diff changeset
8 public static final String CACHE_NAME = "wst-value-table";
07640ab913fd First part of storing qs in ranges
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 626
diff changeset
9
626
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10 private int riverId;
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
11 private int kind;
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
12
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
13 public WstValueTableCacheKey(int riverId, int kind) {
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
14 this.riverId = riverId;
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
15 this.kind = kind;
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
16 }
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
17
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
18 public int hashCode() {
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
19 return (riverId << 8) | kind;
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
20 }
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
21
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
22 public boolean equals(Object other) {
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23 if (!(other instanceof WstValueTableCacheKey)) {
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
24 return false;
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
25 }
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26 WstValueTableCacheKey o = (WstValueTableCacheKey)other;
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
27 return riverId == o.riverId && kind == o.kind;
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28 }
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29 }
e3ee131d5dd3 Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
30 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org