view gnv-artifacts/src/main/java/de/intevation/gnv/math/HeightValue.java @ 1142:12abbf15f18a

dummy merge for repo head
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:15:20 +0200
parents f953c9a559d8
children
line wrap: on
line source
/*
 * Copyright (c) 2010 by Intevation GmbH
 *
 * This program is free software under the LGPL (>=v2.1)
 * Read the file LGPL.txt coming with the software for details
 * or visit http://www.gnu.org/licenses/ if it does not exist.
 */

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