view artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/BunduResultType.java @ 9318:7b2b086e45f0

collision pdf details, ResultType refactoring, bezugswst result
author gernotbelger
date Fri, 27 Jul 2018 10:11:23 +0200
parents
children 0a0937f33bb5
line wrap: on
line source
/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
 * Software engineering by
 *  Björnsen Beratende Ingenieure GmbH
 *  Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
 *
 * This file is Free Software under the GNU AGPL (>=v3)
 * and comes with ABSOLUTELY NO WARRANTY! Check out the
 * documentation coming with Dive4Elements River for details.
 */
package org.dive4elements.river.artifacts.bundu;

import java.text.NumberFormat;

import org.dive4elements.artifacts.CallContext;
import org.dive4elements.river.artifacts.common.AbstractResultType;
import org.dive4elements.river.artifacts.common.I18NStrings;
import org.dive4elements.river.utils.Formatter;

/**
 * @author Domenico Nardi Tironi
 *
 */
public abstract class BunduResultType extends AbstractResultType {

    protected BunduResultType(final String unit, final String csvHeader, final String pdfHeader) {
        super(unit, csvHeader, pdfHeader);
    }

    private static final long serialVersionUID = 1L;

    public static final BunduResultType bezugswst = new BunduResultType(I18NStrings.CSV_META_HEIGHT_UNIT_RIVER, "bundu.wst.export.csv.meta.header.bezugswst",
            "bundu.wst.export.csv.meta.header.bezugswst") { // UNIT needed?
        private static final long serialVersionUID = 1L;

        @Override
        public String exportValue(final CallContext context, final Object value) {
            final double doubleValue = asDouble(value);
            return exportDoubleValue(context, doubleValue);
        }

        @Override
        protected NumberFormat createFormatter(final CallContext context) {
            return Formatter.getWaterlevelQ(context); // Richtiges Format? TODO check!
        }
    };

}

http://dive4elements.wald.intevation.org