Class TimeEncoding
java.lang.Object
org.apache.sis.internal.converter.SurjectiveConverter<String,Instant>
org.apache.sis.internal.storage.csv.TimeEncoding
Specifies how time is encoded in the CSV file.
Time values are formatted as numbers of seconds or minutes since an epoch,
except in the special case of
ABSOLUTE
encoding.- Since:
- 0.7
- Version:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final TimeEncoding
Times are formatted as ISO dates.(package private) static final CommonCRS.Temporal
The temporal coordinate reference system to use forABSOLUTE
time encoding.private final double
Number of milliseconds between two consecutive integer values on the time axis.private final long
Date of value zero on the time axis, in milliseconds since January 1st 1970 at midnight UTC. -
Constructor Summary
ConstructorsConstructorDescriptionTimeEncoding
(org.opengis.referencing.datum.TemporalDatum datum, javax.measure.Unit<javax.measure.quantity.Time> unit) Creates a new time encoding. -
Method Summary
Modifier and TypeMethodDescriptionReturns the instant for the given string, which is usually a time elapsed since the CRS temporal origin.Returns the type of values to convert.Returns the type of converted values.(package private) final double
toCRS
(long time) Converts the given timestamp to the values used in the temporal coordinate reference system.Methods inherited from class org.apache.sis.internal.converter.SurjectiveConverter
inverse, properties, toString
-
Field Details
-
DEFAULT
The temporal coordinate reference system to use forABSOLUTE
time encoding. -
ABSOLUTE
Times are formatted as ISO dates. -
origin
private final long originDate of value zero on the time axis, in milliseconds since January 1st 1970 at midnight UTC. -
interval
private final double intervalNumber of milliseconds between two consecutive integer values on the time axis.
-
-
Constructor Details
-
TimeEncoding
TimeEncoding(org.opengis.referencing.datum.TemporalDatum datum, javax.measure.Unit<javax.measure.quantity.Time> unit) Creates a new time encoding.
-
-
Method Details
-
getSourceClass
Returns the type of values to convert.- Returns:
- the type of objects to convert.
-
getTargetClass
Returns the type of converted values.- Returns:
- the type of converted objects.
-
apply
Returns the instant for the given string, which is usually a time elapsed since the CRS temporal origin.- Parameters:
time
- the string representation of the time to parse, often as a number since the CRS temporal origin.- Returns:
- the instant parsed from the given string.
-
toCRS
final double toCRS(long time) Converts the given timestamp to the values used in the temporal coordinate reference system.- Parameters:
time
- number of milliseconds elapsed since January 1st, 1970 midnight UTC.- Returns:
- the value to use with the temporal coordinate reference system.
-