Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTableCacheKey.java @ 1770:e8a98eee816d
Cosmetics, documentation.
flys-artifacts/trunk@3091 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 26 Oct 2011 12:55:32 +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 : |