ingo@361: package de.intevation.flys.artifacts.model; ingo@361: ingo@361: import java.io.Serializable; ingo@361: import java.util.ArrayList; ingo@361: import java.util.List; 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@361: protected List w; ingo@361: ingo@361: /** The array that contains the 'Q' values.*/ ingo@361: protected List q; ingo@361: ingo@361: /** The array that contains the 'KMs' values.*/ ingo@361: protected List kms; ingo@361: ingo@361: ingo@361: public WQKms() { ingo@361: this.w = new ArrayList(); ingo@361: this.q = new ArrayList(); ingo@361: this.kms = new ArrayList(); 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@361: this.w.add(new Double(w)); ingo@361: this.q.add(new Double(q)); ingo@361: this.kms.add(new Double(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 :