ingo@361: package de.intevation.flys.artifacts.model; ingo@361: ingo@361: import java.io.Serializable; ingo@365: ingo@365: import gnu.trove.TDoubleArrayList; ingo@361: ingo@361: ingo@361: /** ingo@361: * This class represents a pool of data triples that consists of 'W', 'Q' and ingo@361: * 'KM' data. ingo@361: * ingo@361: * @author Ingo Weinzierl ingo@361: */ ingo@361: public class WQKms implements Serializable { ingo@361: ingo@361: /** The array that contains the 'W' values.*/ ingo@365: protected TDoubleArrayList w; ingo@361: ingo@361: /** The array that contains the 'Q' values.*/ ingo@365: protected TDoubleArrayList q; ingo@361: ingo@361: /** The array that contains the 'KMs' values.*/ ingo@365: protected TDoubleArrayList kms; ingo@361: ingo@361: ingo@361: public WQKms() { ingo@365: this.w = new TDoubleArrayList(); ingo@365: this.q = new TDoubleArrayList(); ingo@365: this.kms = new TDoubleArrayList(); ingo@361: } ingo@361: ingo@361: ingo@361: /** ingo@361: * Adds a new row to this data pool. ingo@361: * ingo@361: * @param w a W. ingo@361: * @param q a Q. ingo@361: * @param kms a Kms. ingo@361: */ ingo@361: public void add(double w, double q, double kms) { ingo@365: this.w.add(w); ingo@365: this.q.add(q); ingo@365: this.kms.add(kms); ingo@361: } ingo@361: ingo@361: ingo@361: /** ingo@361: * This method returns a triple of W, Q and Kms in a single 3dim array. ingo@361: * ingo@361: * @param idx The position of the triple. ingo@361: * ingo@361: * @return a triple of [W, Q, Kms]. ingo@361: */ ingo@361: public double[] get(int idx) { ingo@361: return new double[] { w.get(idx), q.get(idx), kms.get(idx) }; ingo@361: } ingo@361: } ingo@361: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :