view flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/RangeState.java @ 743:e95e6df97e55

#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests. flys-artifacts/trunk@2245 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 27 Jun 2011 07:45:32 +0000
parents acf3b49ec31f
children 610d0e0f4f85
line wrap: on
line source
package de.intevation.flys.artifacts.states;

import org.apache.log4j.Logger;


/**
 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
 */
public abstract class RangeState extends DefaultState {

    /** The logger that is used in this class.*/
    private static Logger logger = Logger.getLogger(RangeState.class);


    public RangeState() {
    }


    /**
     * Validates a given range with a given valid range.
     *
     * @param fromValid Valid lower value of the range.
     * @param toValid Valid upper value of the range.
     * @param from The lower value.
     * @param to The upper value.
     * @param step The step width.
     *
     * @return true, if everything was fine, otherwise an exception is thrown.
     */
    protected boolean validateBounds(
        double fromValid, double toValid,
        double from,      double to,      double step)
    throws IllegalArgumentException
    {
        logger.debug("RangeState.validateRange");

        if (from < fromValid) {
            logger.error(
                "Invalid 'from'. " + from + " is smaller than " + fromValid);
            throw new IllegalArgumentException("error_feed_from_out_of_range");
        }
        else if (to > toValid) {
            logger.error(
                "Invalid 'to'. " + to + " is bigger than " + toValid);
            throw new IllegalArgumentException("error_feed_to_out_of_range");
        }
        /*
        else if (from > to) {
            throw new IllegalArgumentException("error_feed_from_bigger_to");
        }
        */

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

http://dive4elements.wald.intevation.org