- All Superinterfaces:
TemporalPrimitive
@UML(identifier="TM_Instant",
specification=ISO_19108)
public interface Instant
extends TemporalPrimitive
A zero-dimensional temporal primitive that represents position in time, equivalent to a point in space.
In practice, an instant is an interval whose duration is less than the resolution of the time scale.
- Since:
- 3.1
-
Method Summary
Modifier and TypeMethodDescriptiondefault TemporalAmountdistance(TemporalPrimitive other) Returns the distance from this instant to another instant or a period (optional operation).default Optional<IndeterminateValue> Returns the reason why the temporal position is missing or inaccurate.Returns the date, time or position on the time-scale represented by this primitive.Methods inherited from interface org.opengis.temporal.TemporalPrimitive
findRelativePosition
-
Method Details
-
getPosition
Returns the date, time or position on the time-scale represented by this primitive. The position can be of the following types:- Date: mapped to the
LocalDateclass. - Time: mapped to the
LocalTimeorOffsetTimeclasses. - Date & time: mapped to the
LocalDateTime,OffsetDateTimeorZonedDateTimeclasses. - Temporal position: mapped to a vendor-specific implementation of the
Temporalinterface, possibly using custom temporal fields. The returned object should also implement theDirectPositioninterface for providing the coordinate value together with its coordinate reference system (CRS).
getIndeterminatePosition()returnsIndeterminateValue.UNKNOWN. In the case ofIndeterminateValue.NOW, this method should return the current time.- Returns:
- the date, time or instant represented by this primitive. Should not be null, except if unknown.
Departure from OGC/ISO standard for harmonization between different specifications
ISO 19108 defines this property as an union ofdate8601,time8601,dateTime8601oranyOtherproperties. Unions are not explicitly supported by the Java language, but the same result is achieved with type hierarchy. The mappings of ISO 19103Date,TimeandDateTimetypes are described in above Javadoc. TheTM_TemporalPositiontype used by theanyOtherproperty is replaced by a vendor-specificTemporalimplementation. - Date: mapped to the
-
getIndeterminatePosition
@UML(identifier="TM_TemporalPosition.indeterminatePosition", obligation=OPTIONAL, specification=ISO_19108) default Optional<IndeterminateValue> getIndeterminatePosition()Returns the reason why the temporal position is missing or inaccurate. When the temporal position is defined, this code provides a qualifier (e.g. "before" or "after") to the temporal position value.- Returns:
- the reason why the position is indeterminate.
Departure from OGC/ISO standard for closer integration with the Java environment
Moved fromTM_TemporalPositiontoTM_Instantbecause the former is replaced by theTemporalstandard Java interface, andTemporaldoes not have an association to theIndeterminateValuecode list. -
distance
@UML(identifier="TM_Separation.distance", obligation=OPTIONAL, specification=ISO_19108) default TemporalAmount distance(TemporalPrimitive other) Returns the distance from this instant to another instant or a period (optional operation). This is the absolute value of the difference between the temporal positions. Ifotheris a period and this instant is contained within that period, then this method shall return a distance of zero.Exceptions
This method shall throw anIndeterminatePositionExceptionif at least one temporal position is indeterminate. ADateTimeExceptionmay also be thrown if the temporal positions are associated to differentTemporalCRS, or if the coordinates are ordinal values, or if theTemporalobjects do not support required temporal fields.- Parameters:
other- the other object from which to measure the distance.- Returns:
- the distance from this instant to another instant or period.
- Throws:
UnsupportedOperationException- if this operation is not supported.IndeterminatePositionException- if at least one temporal position is indeterminate.DateTimeException- if the duration cannot be computed between the two temporal primitives.ArithmeticException- if the duration exceeds the capacity of the implementation.- See Also:
-