Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTableCacheKey.java @ 628:51b69bca4560
ISSUE-85 (part III/III) Use the given kilometer values for the waterlevel computation.
flys-artifacts/trunk@1993 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 24 May 2011 12:37:45 +0000 |
parents | e3ee131d5dd3 |
children | 07640ab913fd |
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 { |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 private int riverId; |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 private int kind; |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 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
|
12 this.riverId = riverId; |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 this.kind = kind; |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 } |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 public int hashCode() { |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 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
|
18 } |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 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
|
21 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
|
22 return false; |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 } |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 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
|
25 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
|
26 } |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 } |
e3ee131d5dd3
Moved WST value table cache key to a separate class.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |