Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/StaticWQKmsCacheKey.java @ 3061:49baebb39305
FixA: Add interpolation of parameters that better suits the instantiation real functions.
flys-artifacts/trunk@4641 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 12 Jun 2012 08:11:36 +0000 |
parents | 17e7a0d063bd |
children |
rev | line source |
---|---|
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
2 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
4 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
5 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
6 * Caching-Key object for 'static' wst- data. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
7 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
8 public final class StaticWQKmsCacheKey |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
9 implements Serializable |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 { |
2090
17e7a0d063bd
Add cache config for static wqkms data.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1825
diff
changeset
|
11 public static final String CACHE_NAME = "wst-wq-value-table-static"; |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 private int column; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 private int wst_id; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 public StaticWQKmsCacheKey(int column, int wst_id) { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 this.wst_id = wst_id; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 this.column = column; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 public int hashCode() { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
22 return (wst_id << 8) | column; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
24 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 public boolean equals(Object other) { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 if (!(other instanceof StaticWQKmsCacheKey)) { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 return false; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 StaticWQKmsCacheKey o = (StaticWQKmsCacheKey) other; |
2090
17e7a0d063bd
Add cache config for static wqkms data.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1825
diff
changeset
|
30 return this.wst_id == o.wst_id && this.column == o.column; |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |