Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java @ 150:c904d52cdfd0
Don't used interleaved x/y data.
flys-artifacts/trunk@1574 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 25 Mar 2011 13:51:09 +0000 |
parents | e8dfe6ba2000 |
children | c97f9bc9b642 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java Fri Mar 25 11:03:51 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java Fri Mar 25 13:51:09 2011 +0000 @@ -28,7 +28,7 @@ protected String riverName; - protected Map<String, double []> values; + protected Map<String, double [][]> values; public DischargeTables() { } @@ -42,15 +42,15 @@ this.gaugeNames = gaugeNames; } - public Map<String, double []> getValues() { + public Map<String, double [][]> getValues() { if (values == null) { values = loadValues(); } return values; } - protected Map<String, double []> loadValues() { - Map<String, double []> values = new HashMap<String, double []>(); + protected Map<String, double [][]> loadValues() { + Map<String, double [][]> values = new HashMap<String, double [][]>(); SessionFactory sf = SessionFactoryProvider.getSessionFactory(); Session session = sf.openSession(); @@ -84,12 +84,13 @@ List<DischargeTableValue> dtvs = table.getDischargeTableValues(); - double [] vs = new double[dtvs.size() << 1]; + double [][] vs = new double[2][dtvs.size()]; int idx = 0; for (DischargeTableValue dtv: dtvs) { - vs[idx++] = dtv.getW().doubleValue(); - vs[idx++] = dtv.getQ().doubleValue(); + vs[0][idx] = dtv.getW().doubleValue(); + vs[1][idx] = dtv.getQ().doubleValue(); + ++idx; } values.put(gaugeName, vs);