view gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/gap/TimeGap.java @ 1115:f953c9a559d8

Added license file and license headers. gnv-artifacts/trunk@1260 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 02 Nov 2010 17:46:55 +0000
parents 05bf8534a35a
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.timeseries.gap;

import java.io.Serializable;

/**
 * A class representing a timegap. <code>TimeGap</code>s are used in timeseries
 * charts to identify gaps taking account for the resolution of the x-axis
 * range.
 *
 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
 */
public interface TimeGap extends Serializable {

    public final static String TIME_UNIT_MINUTE = "m";
    public final static String TIME_UNIT_HOUR = "h";
    public final static String TIME_UNIT_DAY = "D";
    public final static String TIME_UNIT_WEEK = "W";
    public final static String TIME_UNIT_MONTH = "M";
    public final static String TIME_UNIT_YEAR = "Y";

    public final static long  MINUTE_IN_MILLIS = 60 * 1000;
    public final static long  HOUR_IN_MILLIS = 60 * MINUTE_IN_MILLIS;
    public final static long  DAY_IN_MILLIS = 24 * HOUR_IN_MILLIS;
    public final static long  WEEK_IN_MILLIS = 7 * DAY_IN_MILLIS;


    /**
     * Returns the Lookup-Key for the TimeGap
     *
     * @return the timegap key.
     */
    int getKey();

    /**
     * Returns the Value of the TimeValue in the Unit which is also given.
     *
     * @return the timegap value.
     */
    int getValue();

    /**
     * Returns the Unit of the Timegap (e.g. Minutes, Hours, Days, Weeks, Months, Years)
     *
     * @return the timegap unit.
     */
    String getUnit();

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

http://dive4elements.wald.intevation.org