view artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/SectorRange.java @ 9646:0380717105ba

Implemented alternative fitting strategy for Log-Linear function.
author Gernot Belger <g.belger@bjoernsen.de>
date Mon, 02 Dec 2019 17:56:15 +0100
parents 9744ce3c3853
children
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.model.fixings;

import org.dive4elements.river.artifacts.model.Range;

final class SectorRange extends Range {

    private static final double EPSILON = 1e-2;

    private static final long serialVersionUID = 1L;

    private int sector;

    public SectorRange() {
    }

    public SectorRange(final SectorRange other) {
        super(other);

        this.sector = other.sector;
    }

    public SectorRange(final Range range) {
        super(range);
    }

    public int getSector() {
        return this.sector;
    }

    public void setSector(final int sector) {
        this.sector = sector;
    }

    public boolean enlarge(final SectorRange other) {
        if (this.sector == other.sector && Math.abs(this.getEnd() - other.getStart()) < EPSILON) {
            setEnd(other.getEnd());
            return true;
        }
        return false;
    }
}

http://dive4elements.wald.intevation.org