- All Superinterfaces:
TemporalPrimitive
@UML(identifier="TM_Period",
specification=ISO_19108)
public interface Period
extends TemporalPrimitive
A one-dimensional temporal primitive that represent extent in time.
A period is an open interval bounded by beginning and ending points.
Those two points should be of the same class. For example,
if the beginning is an instance of
LocalDate
,
then the ending
should also be an instance of LocalDate
.
If the two points are direct positions,
then they shall be associated to the same TemporalCRS.- Since:
- 3.1
-
Method Summary
Modifier and TypeMethodDescriptionReturns the beginning instant at which this period starts.Returns the ending instant at which this period ends.default TemporalAmount
length()
Returns the duration of this period (optional operation).Methods inherited from interface org.opengis.temporal.TemporalPrimitive
findRelativePosition
-
Method Details
-
getBeginning
Returns the beginning instant at which this period starts. Its position on the timeline shall be before the period ending.- Returns:
- the beginning instant at which this period starts.
-
getEnding
Returns the ending instant at which this period ends. Its position on the timeline shall be after the period beginning.- Returns:
- the ending instant at which this period ends.
-
length
@UML(identifier="TM_Separation.length", obligation=OPTIONAL, specification=ISO_19108) default TemporalAmount length()Returns the duration of this period (optional operation). This is the distance between the period beginning and ending positions. The default implementation is as below:return getBeginning().distance(getEnding());
Exceptions
This method shall throw anIndeterminatePositionException
if the temporal position of a bound is indeterminate. ADateTimeException
may also be thrown if the coordinates areordinal values
.- Returns:
- duration of this period.
- Throws:
UnsupportedOperationException
- if this operation is not supported.IndeterminatePositionException
- if the temporal position of a bound is indeterminate.DateTimeException
- if the duration cannot be computed between the temporal objects used as bounds.ArithmeticException
- if the duration exceeds the capacity of the implementation.- See Also:
-