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@3887: teichmann@7913: import java.util.Calendar; raimund@3898: import java.util.Date; raimund@3898: raimund@3887: import gnu.trove.TDoubleArrayList; raimund@3887: raimund@3887: raimund@3887: public class BedDiffEpochResult raimund@3887: extends BedDifferencesResult raimund@3887: { raimund@3887: raimund@3898: protected Date start; raimund@3898: protected Date end; raimund@3898: raimund@3887: public BedDiffEpochResult () { raimund@3887: super(); raimund@3887: } raimund@3887: raimund@3887: public BedDiffEpochResult ( raimund@3887: TDoubleArrayList kms, raimund@3887: TDoubleArrayList differences, raimund@3898: TDoubleArrayList heights1, raimund@3898: TDoubleArrayList heights2, raimund@3898: Date start, raimund@3898: Date end raimund@3887: ) { raimund@3898: super(kms, differences, heights1, heights2); raimund@3898: this.start = start; raimund@3898: this.end = end; raimund@3898: } raimund@3898: raimund@3898: public Date getStart() { raimund@3898: return this.start; raimund@3898: } raimund@3898: rrenkert@4636: public void setStart(Date value) { rrenkert@4636: this.start = value; rrenkert@4636: } rrenkert@4636: rrenkert@4636: public void setEnd(Date value) { rrenkert@4636: this.end = value; rrenkert@4636: } rrenkert@4636: raimund@3898: public Date getEnd() { raimund@3898: return this.end; raimund@3887: } teichmann@7913: teichmann@7913: private static final int extractYear(Date date) { teichmann@7913: if (date == null) { teichmann@7913: return 0; teichmann@7913: } teichmann@7913: Calendar c = Calendar.getInstance(); teichmann@7913: c.setTime(date); teichmann@7913: return c.get(Calendar.YEAR); teichmann@7913: } teichmann@7913: teichmann@7913: @Override teichmann@7913: public String getDiffDescription() { teichmann@7913: int y1 = extractYear(start); teichmann@7913: int y2 = extractYear(end); teichmann@7913: return y1 + " - " + y2; teichmann@7913: } raimund@3887: }