annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/StaticWQKmsCacheKey.java @ 8569:26c7aa469bfc

Readd StaticWQKmsCacheKey and use it again. This class was removed under the assumption that it only wrapped the Cache Key but the WQKmsfactory also uses this.
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 26 Feb 2015 15:52:04 +0100
parents
children 23264d1a528f
rev   line source
8569
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
3 *
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
6 * documentation coming with Dive4Elements River for details.
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
7 */
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
8
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
9 package org.dive4elements.river.artifacts.model;
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
10
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
11 import java.io.Serializable;
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
12
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
13 /**
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
14 * Caching-Key object for 'static' wst- data.
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
15 */
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
16 public final class StaticWQKmsCacheKey
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
17 implements Serializable
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
18 {
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
19 public static final String CACHE_NAME = "wst-wq-value-table-static";
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
20
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
21 private int column;
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
22 private int wst_id;
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
23
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
24 public StaticWQKmsCacheKey(int column, int wst_id) {
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
25 this.wst_id = wst_id;
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
26 this.column = column;
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
27 }
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
28
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
29 public int hashCode() {
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
30 return (wst_id << 8) | column;
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
31 }
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
32
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
33 public boolean equals(Object other) {
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
34 if (!(other instanceof StaticWQKmsCacheKey)) {
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
35 return false;
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
36 }
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
37 StaticWQKmsCacheKey o = (StaticWQKmsCacheKey) other;
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
38 return this.wst_id == o.wst_id && this.column == o.column;
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
39 }
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
40 }
26c7aa469bfc Readd StaticWQKmsCacheKey and use it again.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
41 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org