Enum CommonCRS.Temporal
- All Implemented Interfaces:
Serializable,Comparable<CommonCRS.Temporal>
- Enclosing class:
- CommonCRS
Referencing objects are cached after creation. Invoking the same method on the same Temporal
instance twice will return the same IdentifiedObject instance, unless the internal cache has been cleared
(e.g. the application is running in a container environment and some modules have been installed or uninstalled).
Example: the following code fetches a temporal Coordinate Reference System using the Julian calendar:
Below is an alphabetical list of object names available in this enumeration. Note that the namespace of identifiers ("OGC" versus "SIS") may change in any future version.
Temporal objects accessible by enumeration constants Name or alias Identifier Object type Enumeration value Dublin Julian SIS:DublinJulianCRS, Datum DUBLIN_JULIANJava time SIS:JavaTimeCRS JAVAJulian OGC:JulianDateCRS, Datum JULIANModified Julian SIS:ModifiedJulianDateCRS, Datum MODIFIED_JULIANTruncated Julian OGC:TruncatedJulianDateCRS, Datum TRUNCATED_JULIANUnix/POSIX time OGC:UnixTimeCRS, Datum UNIX
- Since:
- 0.4
- Version:
- 1.3
- See Also:
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTime measured as days since December 31, 1899 at 12:00 UTC.Time measured as milliseconds since January 1st, 1970 at 00:00 UTC.Time measured as days since January 1st, 4713 BC at 12:00 UTC in proleptic Julian calendar.Time measured as days since November 17, 1858 at 00:00 UTC.Time measured as days since May 24, 1968 at 00:00 UTC.Time measured as seconds since January 1st, 1970 at 00:00 UTC. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.opengis.referencing.IdentifiedObjectThe cached object.private final longThe date and time origin of this temporal datum.private final StringIdentifier in OGC or SIS namespace.private final booleanWhether the identifier is in OGC namespace.private final shortThe resource keys for the name as one of theVocabulary.Keysconstants. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final voidclear()Invoked by when the cache needs to be cleared after a classpath change.org.opengis.referencing.crs.TemporalCRScrs()Returns the coordinate reference system associated to this temporal object.private static org.opengis.referencing.crs.TemporalCRScrs(org.opengis.referencing.IdentifiedObject object) Returns the temporal CRS associated to the given object, ornullif none.private org.opengis.referencing.cs.TimeCScs()Creates the coordinate system associated to this temporal object.org.opengis.referencing.datum.TemporalDatumdatum()Returns the datum associated to this temporal object.private static org.opengis.referencing.datum.TemporalDatumdatum(org.opengis.referencing.IdentifiedObject object) Returns the datum associated to the given object, ornullif none.static CommonCRS.TemporalReturns the enumeration value for the given epoch, ornullif none.static CommonCRS.TemporalforIdentifier(String identifier, boolean onlyOGC) Returns the enumeration value for the given identifier (without namespace).static CommonCRS.TemporalReturns the enum constant of this type with the specified name.static CommonCRS.Temporal[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
JULIAN
Time measured as days since January 1st, 4713 BC at 12:00 UTC in proleptic Julian calendar. This epoch is equivalent to November 24, 4714 BC when expressed in the proleptic Gregorian calendar instead of the Julian one.Note on dates formatting: the legacy date/time formatting classes in the
java.textpackage uses the proleptic Julian calendar for dates before October 15, 1582, while the new date/time formatting classes in thejava.time.formatpackage use the ISO-8601 calendar system, which is equivalent to the proleptic Gregorian calendar for every dates. For parsing and formatting of Julian days, theSimpleDateFormatclass is closer to the common practice (but not ISO 8601 compliant). -
MODIFIED_JULIAN
Time measured as days since November 17, 1858 at 00:00 UTC. A Modified Julian day (MJD) is defined relative to Julian day (JD) asMJD = JD − 2400000.5. -
TRUNCATED_JULIAN
Time measured as days since May 24, 1968 at 00:00 UTC. This epoch was introduced by NASA for the space program. A Truncated Julian day (TJD) is defined relative to Julian day (JD) asTJD = JD − 2440000.5. -
DUBLIN_JULIAN
Time measured as days since December 31, 1899 at 12:00 UTC. A Dublin Julian day (DJD) is defined relative to Julian day (JD) asDJD = JD − 2415020. -
UNIX
Time measured as seconds since January 1st, 1970 at 00:00 UTC. -
JAVA
Time measured as milliseconds since January 1st, 1970 at 00:00 UTC.
-
-
Field Details
-
key
private final short keyThe resource keys for the name as one of theVocabulary.Keysconstants. -
epoch
private final long epochThe date and time origin of this temporal datum. -
identifier
Identifier in OGC or SIS namespace.- See Also:
-
isOGC
private final boolean isOGCWhether the identifier is in OGC namespace. -
cached
private transient volatile org.opengis.referencing.IdentifiedObject cachedThe cached object. This is initiallynull, then set to various kinds of objects depending on which method has been invoked. The kind of object stored in this field may change during the application execution.
-
-
Constructor Details
-
Temporal
Creates a new enumeration value of the given name with time counted since the given epoch.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
clear
final void clear()Invoked by when the cache needs to be cleared after a classpath change. -
forIdentifier
Returns the enumeration value for the given identifier (without namespace). Identifiers in OGC namespace are"JulianDate","TruncatedJulianDate"and"UnixTime". Identifiers in SIS namespace are"ModifiedJulianDate","DublinJulian"and"JavaTime". Note that the content of OGC and SIS namespaces may change in any future version.- Parameters:
identifier- case-insensitive identifier of the desired temporal CRS, without namespace.onlyOGC- whether to return the CRS only if its identifier is in OGC namespace.- Returns:
- the enumeration value for the given identifier.
- Throws:
IllegalArgumentException- if the given identifier is not recognized.- Since:
- 1.3
- See Also:
-
forEpoch
Returns the enumeration value for the given epoch, ornullif none. If the epoch is January 1st, 1970, then this method returnsUNIX.- Parameters:
epoch- the epoch for which to get an enumeration value, ornull.- Returns:
- the enumeration value for the given epoch, or
nullif none. - Since:
- 1.0
-
crs
public org.opengis.referencing.crs.TemporalCRS crs()Returns the coordinate reference system associated to this temporal object. The following table summarizes the CRS known to this class, together with an enumeration value that can be used for fetching that CRS:Commonly used temporal CRS Name or alias Enum Dublin Julian DUBLIN_JULIANJulian JULIANModified Julian MODIFIED_JULIANTruncated Julian TRUNCATED_JULIANUnix/POSIX UNIXJava DateJAVA- Returns:
- the CRS associated to this enum.
- See Also:
-
cs
private org.opengis.referencing.cs.TimeCS cs()Creates the coordinate system associated to this temporal object. This method does not cache the coordinate system. -
datum
public org.opengis.referencing.datum.TemporalDatum datum()Returns the datum associated to this temporal object. The following table summarizes the datum known to this class, together with an enumeration value that can be used for fetching that datum:Commonly used temporal datum Name or alias Enum Dublin Julian DUBLIN_JULIANJulian JULIANModified Julian MODIFIED_JULIANTruncated Julian TRUNCATED_JULIANUnix/POSIX or Java UNIX- Returns:
- the datum associated to this enum.
- See Also:
-
crs
private static org.opengis.referencing.crs.TemporalCRS crs(org.opengis.referencing.IdentifiedObject object) Returns the temporal CRS associated to the given object, ornullif none. -
datum
private static org.opengis.referencing.datum.TemporalDatum datum(org.opengis.referencing.IdentifiedObject object) Returns the datum associated to the given object, ornullif none.
-