Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/math/XYColumn.java @ 429:bed9735adf84
Finished preprocessing data for interpolation in verticalcrosssection charts.ß
gnv-artifacts/trunk@477 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 22 Dec 2009 17:19:10 +0000 |
parents | a95aaeb206f7 |
children | 422275fc9927 |
comparison
equal
deleted
inserted
replaced
428:88cd37c3b5e4 | 429:bed9735adf84 |
---|---|
1 package de.intevation.gnv.math; | 1 package de.intevation.gnv.math; |
2 | 2 |
3 import java.io.Serializable; | |
3 import java.util.ArrayList; | 4 import java.util.ArrayList; |
4 import java.util.List; | 5 import java.util.List; |
5 | 6 |
6 /** | 7 /** |
7 * @author Ingo Weinzierl <ingo.weinzierl@intevation.de> | 8 * @author Ingo Weinzierl <ingo.weinzierl@intevation.de> |
8 */ | 9 */ |
9 public class XYColumn { | 10 public class XYColumn |
11 implements Serializable | |
12 { | |
10 | 13 |
11 private double x; | 14 private double x; |
12 private double y; | 15 private double y; |
13 | 16 |
14 private int i; | 17 private int i; |
19 public XYColumn(double x, double y, int i, int j) { | 22 public XYColumn(double x, double y, int i, int j) { |
20 this.x = x; | 23 this.x = x; |
21 this.y = y; | 24 this.y = y; |
22 this.i = i; | 25 this.i = i; |
23 this.j = j; | 26 this.j = j; |
24 | |
25 values = new ArrayList(); | |
26 } | 27 } |
27 | 28 |
28 | 29 |
29 public void add(HeightValue value) { | 30 public void add(HeightValue value) { |
31 if (values == null) { | |
32 values = new ArrayList(); | |
33 } | |
30 values.add(value); | 34 values.add(value); |
31 } | 35 } |
32 | 36 |
33 | 37 |
34 public HeightValue[] getValues() { | 38 public HeightValue[] getValues() { |
35 return (HeightValue[]) values.toArray(new HeightValue[values.size()]); | 39 return (HeightValue[]) values.toArray(new HeightValue[values.size()]); |
36 } | 40 } |
41 | |
42 | |
43 public int hashCode() { | |
44 return (i << 16) | j; | |
45 } | |
46 | |
47 | |
48 public boolean equals(Object obj) { | |
49 XYColumn other = (XYColumn) obj; | |
50 | |
51 return i == other.i && j == other.j && x == other.x && y == other.y; | |
52 } | |
37 } | 53 } |