Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FixingsColumn.java @ 2619:6ed24efc80de
Loaded columns of fixings from database and store them into the cache.
flys-artifacts/trunk@4204 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 05 Apr 2012 15:29:52 +0000 |
parents | b0597a63fe70 |
children | a441be7f1589 |
comparison
equal
deleted
inserted
replaced
2618:3a93bbbe2ec7 | 2619:6ed24efc80de |
---|---|
7 import java.io.Serializable; | 7 import java.io.Serializable; |
8 | 8 |
9 public class FixingsColumn | 9 public class FixingsColumn |
10 implements Serializable | 10 implements Serializable |
11 { | 11 { |
12 protected int columnId; | |
13 | |
14 protected double [] kms; | 12 protected double [] kms; |
15 protected double [] ws; | 13 protected double [] ws; |
16 | 14 |
17 protected QRangeTree qs; | 15 protected QRangeTree qs; |
18 | 16 |
19 public FixingsColumn() { | 17 public FixingsColumn() { |
20 } | 18 } |
21 | 19 |
22 public FixingsColumn( | 20 public FixingsColumn( |
23 int columnId, | 21 double [] kms, |
24 double [] kms, | 22 double [] ws, |
25 double [] ws | 23 QRangeTree qs |
26 ) { | 24 ) { |
27 this.columnId = columnId; | 25 this.kms = kms; |
28 this.kms = kms; | 26 this.ws = ws; |
29 this.ws = ws; | 27 this.qs = qs; |
30 } | |
31 | |
32 public int getColumnId() { | |
33 return columnId; | |
34 } | 28 } |
35 | 29 |
36 public boolean getW(double km, double [] w) { | 30 public boolean getW(double km, double [] w) { |
37 | 31 |
38 if (km < kms[0] || km > kms[kms.length-1]) { | 32 if (kms.length == 0 || km < kms[0] || km > kms[kms.length-1]) { |
39 w[0] = Double.NaN; | 33 w[0] = Double.NaN; |
40 return true; | 34 return true; |
41 } | 35 } |
42 | 36 |
43 int idx = Arrays.binarySearch(kms, km); | 37 int idx = Arrays.binarySearch(kms, km); |