view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/StaticSedimentLoadCacheKey.java @ 4370:6a65e7ef43c0

Updated data object and factory for sediment load. * Added new data fields to object and cache key. * Fixed SQL statement in factory and fill load objects correctly. *
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 02 Nov 2012 14:48:16 +0100
parents 3051bc28ac43
children 3937c6a85db4
line wrap: on
line source
package de.intevation.flys.artifacts.model;

import java.util.Date;

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;
    }

    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();
    }

    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