view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/StaticSedimentLoadCacheKey.java @ 4478:6153c50f78cf

WaterLineArtifact: Added callcontext-parameter to interfaces getWaterLine. Update all implementations. The change was done to be able to compute the extreme values during getWaterLine to access data needed in CrossSectionProfile Diagrams.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 13 Nov 2012 14:46:44 +0100
parents 3937c6a85db4
children
line wrap: on
line source
package de.intevation.flys.artifacts.model;

import org.apache.commons.lang.builder.HashCodeBuilder;


public class StaticSedimentLoadCacheKey
{
    public static final String CACHE_NAME = "sedimentload-value-table-static";

    private String river;
    private double startKm;
    private double endKm;
    private int sYear;
    private int eYear;

    public StaticSedimentLoadCacheKey(
        String river,
        double startKm,
        double endKm,
        int sYear,
        int eYear
    ) {
        this.river = river;
        this.startKm = startKm;
        this.endKm = endKm;
        this.sYear = sYear;
        this.eYear = eYear;
    }

    @Override
    public int hashCode() {
        HashCodeBuilder builder = new HashCodeBuilder();
        builder.append(river);
        builder.append(startKm);
        builder.append(endKm);
        builder.append(sYear);
        builder.append(eYear);
        return builder.toHashCode();
    }

    @Override
    public boolean equals(Object other) {
        if (!(other instanceof StaticBedHeightCacheKey)) {
            return false;
        }
        StaticSedimentLoadCacheKey o = (StaticSedimentLoadCacheKey) other;
        return this.river == o.river &&
            this.startKm == o.startKm &&
            this.endKm == o.endKm &&
            this.sYear == o.sYear &&
            this.eYear == o.eYear;
    }
}

http://dive4elements.wald.intevation.org