Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/math/HeightValue.java @ 807:a645bd23c1c8
Added more javadoc. Removed trailing whitespace.
gnv-artifacts/trunk@889 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 08 Apr 2010 15:24:45 +0000 |
parents | 6cff63d0c434 |
children | f953c9a559d8 |
comparison
equal
deleted
inserted
replaced
806:2cea76f1112e | 807:a645bd23c1c8 |
---|---|
3 import java.io.Serializable; | 3 import java.io.Serializable; |
4 | 4 |
5 import java.util.Comparator; | 5 import java.util.Comparator; |
6 | 6 |
7 /** | 7 /** |
8 * An attributed height value. It holds a z value, a parameter value | |
9 * and a layer index. | |
10 * | |
8 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 11 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
9 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> | 12 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> |
10 */ | 13 */ |
11 public class HeightValue | 14 public class HeightValue |
12 implements Serializable | 15 implements Serializable |
13 { | 16 { |
17 /** | |
18 * Comparator to sort <code>HeightValue</code>s by their z value | |
19 * in reversed order. | |
20 */ | |
14 public static final Comparator INV_Z_COMPARATOR = new Comparator() { | 21 public static final Comparator INV_Z_COMPARATOR = new Comparator() { |
15 public int compare(Object a, Object b) { | 22 public int compare(Object a, Object b) { |
16 HeightValue ha = (HeightValue)a; | 23 HeightValue ha = (HeightValue)a; |
17 HeightValue hb = (HeightValue)b; | 24 HeightValue hb = (HeightValue)b; |
18 if (ha.z > hb.z) return -1; | 25 if (ha.z > hb.z) return -1; |
19 if (ha.z < hb.z) return +1; | 26 if (ha.z < hb.z) return +1; |
20 return 0; | 27 return 0; |
21 } | 28 } |
22 }; | 29 }; |
23 | 30 |
31 /** | |
32 * The height value. | |
33 */ | |
24 public double z; | 34 public double z; |
35 | |
36 /** | |
37 * The parameter value. | |
38 */ | |
25 public double v; | 39 public double v; |
40 | |
41 /** | |
42 * The layer index; | |
43 */ | |
26 public int k; | 44 public int k; |
27 | 45 |
46 /** | |
47 * Constructor to create a HeightValue with a given height, | |
48 * parameter value and layer index. | |
49 * @param z The height. | |
50 * @param v The parameter value. | |
51 * @param k The layer index. | |
52 */ | |
28 public HeightValue(double z, double v, int k) { | 53 public HeightValue(double z, double v, int k) { |
29 this.z = z; | 54 this.z = z; |
30 this.v = v; | 55 this.v = v; |
31 this.k = k; | 56 this.k = k; |
32 } | 57 } |
33 | 58 |
59 /** | |
60 * Return the height of this HeightValue. | |
61 * @return the height. | |
62 */ | |
34 public double getZ() { | 63 public double getZ() { |
35 return z; | 64 return z; |
36 } | 65 } |
37 | 66 |
67 /** | |
68 * Return the parameter value of this HeightValue. | |
69 * @return The parameter value. | |
70 */ | |
38 public double getV() { | 71 public double getV() { |
39 return v; | 72 return v; |
40 } | 73 } |
41 | 74 |
75 /** | |
76 * Returns the layer index of this HeightValue. | |
77 * @return The layer index. | |
78 */ | |
42 public double getK() { | 79 public double getK() { |
43 return k; | 80 return k; |
44 } | 81 } |
45 } | 82 } |
46 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 83 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |