All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.time4j.engine.TimeMetric Maven / Gradle / Ivy

There is a newer version: 4.38
Show newest version
/*
 * -----------------------------------------------------------------------
 * Copyright © 2013-2015 Meno Hochschild, 
 * -----------------------------------------------------------------------
 * This file (TimeMetric.java) is part of project Time4J.
 *
 * Time4J is free software: You can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * Time4J is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Time4J. If not, see .
 * -----------------------------------------------------------------------
 */

package net.time4j.engine;


/**
 * 

Computes temporal distances on a time axis as time spans.

* * @param generic type of time unit * @param

generic type of duration type * @author Meno Hochschild */ /*[deutsch] *

Berechnet Abstände auf einer Zeitachse als Zeitspannen.

* * @param generic type of time unit * @param

generic type of duration type * @author Meno Hochschild */ public interface TimeMetric { //~ Methoden ---------------------------------------------------------- /** *

Computes the temporal distance between two time points.

* *

Important note: This method might not work in Java 6 under some circumstances. * In case of any problem users can use the equivalent method {@code until()} defined in the class * {@code TimePoint}.

* * @param generic type of time point * @param start first time point * @param end second time point * @return calculated time span between given time points, will be * negative if {@code start} is after {@code end} * @see TimePoint#until(TimePoint, TimeMetric) */ /*[deutsch] *

Berechnet den zeitlichen Abstand zwischen zwei Zeitpunkten.

* *

Wichtiger Hinweis: Diese Methode mag in Java 6 unter bestimmten Umständen nicht * funktionieren. Ist das der Fall, können Anwender auf die äquivalente Methode * {@code until()} definiert in der Klasse {@code TimePoint} ausweichen.

* * @param generic type of time point * @param start first time point * @param end second time point * @return calculated time span between given time points, will be * negative if {@code start} is after {@code end} * @see TimePoint#until(TimePoint, TimeMetric) */ > P between( T start, T end ); }