view flys-backend/src/main/java/de/intevation/flys/importer/WstColumnValueKey.java @ 490:13af9318a4a2

Import "Hochwasser-Marken", too. flys-backend/trunk@1838 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 05 May 2011 14:46:41 +0000
parents db430bd9e0e0
children
line wrap: on
line source
package de.intevation.flys.importer;

import de.intevation.flys.model.WstColumnValue;


public class WstColumnValueKey {

    protected int    wstColumnId;
    protected double position;
    protected double w;


    public WstColumnValueKey(WstColumnValue value) {
        this.wstColumnId = value.getWstColumn().getId();
        this.position    = value.getPosition().doubleValue();
        this.w           = value.getW().doubleValue();
    }


    public WstColumnValueKey(int wstColumnId, double position, double w) {
        this.wstColumnId = wstColumnId;
        this.position    = position;
        this.w           = w;
    }


    public int hashCode() {
        int a = new Integer(wstColumnId).hashCode();
        int b = new Double(position).hashCode();
        int c = new Double(w).hashCode();

        return (a ^ (b << 3) ^ (c << 6));
    }


    public boolean equals(Object obj) {
        if (!(obj instanceof WstColumnValueKey)) {
            return false;
        }

        WstColumnValueKey other = (WstColumnValueKey) obj;

        if (this.wstColumnId != other.wstColumnId) {
            return false;
        }
        else if (this.position != other.position) {
            return false;
        }
        else if (this.w != other.w) {
            return false;
        }

        return true;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org