Package net.time4j.engine
Interface TimeMetric<U,P>
- Type Parameters:
U- generic type of time unitP- generic type of duration object
- All Known Implementing Classes:
AbstractMetric
public interface TimeMetric<U,P>
Computes temporal distances on a time axis as time spans.
- Author:
- Meno Hochschild
-
Method Summary
Modifier and TypeMethodDescriptionbetween(T start, T end)Computes the temporal distance between two time points.default TimeMetric<U,P>Obtains a modified metric which has reversible characteristics.
-
Method Details
-
between
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
until()defined in the classTimePoint.- Type Parameters:
T- generic type of time point- Parameters:
start- first time pointend- second time point- Returns:
- calculated time span between given time points, will be
negative if
startis afterend - See Also:
TimePoint.until(TimePoint, TimeMetric)
-
reversible
Obtains a modified metric which has reversible characteristics.
Usually metrics are not reversible by default. The default implementation throws an
UnsupportedOperationException. Overriding implementations should document the details of reversal characteristics.- Returns:
- modified reversible time metric
- Throws:
UnsupportedOperationException- if not supported- Since:
- 5.5
-