teichmann@5863: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5863: * Software engineering by Intevation GmbH teichmann@5863: * teichmann@5994: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5863: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5994: * documentation coming with Dive4Elements River for details. teichmann@5863: */ teichmann@5863: teichmann@5831: package org.dive4elements.river.artifacts.model.minfo; raimund@3760: raimund@3760: import java.io.Serializable; ingo@3784: import java.util.LinkedList; ingo@3784: import java.util.List; raimund@3760: teichmann@5831: import org.dive4elements.river.artifacts.model.DateRange; raimund@3760: ingo@3784: public class BedQualityResult ingo@3784: implements Serializable ingo@3784: { raimund@3760: andre@8587: protected LinkedList values; raimund@3760: protected DateRange dateRange; raimund@3760: raimund@3760: public BedQualityResult () { andre@8587: values = new LinkedList(); ingo@3784: }; raimund@3760: raimund@3760: public BedQualityResult ( andre@8587: LinkedList values, raimund@3760: DateRange range raimund@3760: ) { raimund@3760: this.dateRange = range; andre@8587: this.values = values; raimund@3760: } raimund@3760: andre@8587: public void add(BedQualityResultValue[] values) { andre@8587: for (BedQualityResultValue value: values) { andre@8587: add(value); andre@8587: } ingo@3784: } ingo@3784: andre@8587: public void add(BedQualityResultValue value) { andre@8587: /* Add first is here to mimic the result sorting before andre@8587: * a refactorization.*/ andre@8587: values.addFirst(value); ingo@3784: } ingo@3784: andre@8587: public List getValues() { andre@8587: return values; ingo@3784: } ingo@3784: andre@8587: public BedQualityResultValue getValue(String name, String type) { andre@8587: for (BedQualityResultValue value: values) { andre@8587: if (name.equals(value.getName()) && type.equals(value.getType())) { andre@8587: return value; andre@8587: } andre@8587: } andre@8587: return null; raimund@3760: } raimund@3760: raimund@3760: public DateRange getDateRange() { ingo@3784: return dateRange; raimund@3760: } raimund@3760: ingo@3784: public void setDateRange(DateRange range) { ingo@3784: this.dateRange = range; ingo@3766: } raimund@3760: }