view gnv-artifacts/src/main/java/de/intevation/gnv/math/HeightValue.java @ 867:35c3e82f7eaa

Changed the default directory of the artifact database. gnv-artifacts/trunk@1006 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 27 Apr 2010 15:11:16 +0000
parents a645bd23c1c8
children f953c9a559d8
line wrap: on
line source
package de.intevation.gnv.math;

import java.io.Serializable;

import java.util.Comparator;

/**
 * An attributed height value. It holds a z value, a parameter value
 * and a layer index.
 *
 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a>
 */
public class HeightValue
implements   Serializable
{
    /**
     * Comparator to sort <code>HeightValue</code>s by their z value
     * in reversed order.
     */
    public static final Comparator INV_Z_COMPARATOR = new Comparator() {
        public int compare(Object a, Object b) {
            HeightValue ha = (HeightValue)a;
            HeightValue hb = (HeightValue)b;
            if (ha.z > hb.z) return -1;
            if (ha.z < hb.z) return +1;
            return 0;
        }
    };

    /**
     * The height value.
     */
    public double z;

    /**
     * The parameter value.
     */
    public double v;

    /**
     * The layer index;
     */
    public int    k;

    /**
     * Constructor to create a HeightValue with a given height,
     * parameter value and layer index.
     * @param z The height.
     * @param v The parameter value.
     * @param k The layer index.
     */
    public HeightValue(double z, double v, int k) {
        this.z = z;
        this.v = v;
        this.k = k;
    }

    /**
     * Return the height of this HeightValue.
     * @return the height.
     */
    public double getZ() {
        return z;
    }

    /**
     * Return the parameter value of this HeightValue.
     * @return The parameter value.
     */
    public double getV() {
        return v;
    }

    /**
     * Returns the layer index of this HeightValue.
     * @return The layer index.
     */
    public double getK() {
        return k;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org