# Enum Class CommonCRS.Temporal

Object
Enum<CommonCRS.Temporal>
Temporal

All Implemented Interfaces:
  `Serializable, Comparable<CommonCRS​.Temporal>, Constable`

Enclosing class:
  `CommonCRS`

public static enum CommonCRS.Temporal extends Enum<CommonCRS.Temporal>
Frequently-used temporal CRS and datum that are guaranteed to be available in SIS.

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:

    TemporalCRS crs = CommonCRS.Temporal.JULIAN.crs();

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:DublinJulian` | CRS, Datum | `DUBLIN_JULIAN`
> Java time | `SIS:JavaTime` | CRS | `JAVA`
> Julian | `OGC:JulianDate` | CRS, Datum | `JULIAN`
> Modified Julian | `SIS:ModifiedJulianDate` | CRS, Datum | `MODIFIED_JULIAN`
> Tropical year | `SIS:TropicalYear` | CRS | `TROPICAL_YEAR`
> Truncated Julian | `OGC:TruncatedJulianDate` | CRS, Datum | `TRUNCATED_JULIAN`
> Unix/POSIX time | `OGC:UnixTime` | CRS, Datum | `UNIX`

Since:
  0.4
See Also:
  - `CommonCRS​.defaultTemporal()`
  - `CommonCRS​.Engineering​.TIME`

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class Enum

  `Enum​.EnumDesc<E>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `DUBLIN_JULIAN`
  Time measured as days since December 31, 1899 at 12:00 UTC.
  `JAVA`
  Time measured as milliseconds since January 1st, 1970 at 00:00 UTC.
  `JULIAN`
  Time measured as days since January 1st, 4713 BC at 12:00 UTC in proleptic Julian calendar.
  `MODIFIED_JULIAN`
  Time measured as days since November 17, 1858 at 00:00 UTC.
  `TROPICAL_YEAR`
  Time measured in units of tropical years since January 1, 2000 at 00:00 UTC.
  `TRUNCATED_JULIAN`
  Time measured as days since May 24, 1968 at 00:00 UTC.
  `UNIX`
  Time measured as seconds since January 1st, 1970 at 00:00 UTC.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TemporalCRS`
  `crs()`
  Returns the coordinate reference system associated to this temporal object.
  `TemporalDatum`
  `datum()`
  Returns the datum associated to this temporal object.
  `static CommonCRS​.Temporal`
  `forEpoch(Instant epoch)`
  Returns the enumeration value for the given epoch, or `null` if none.
  `static CommonCRS​.Temporal`
  `forIdentifier(String identifier, boolean onlyOGC)`
  Returns the enumeration value for the given identifier (without namespace).
  `static CommonCRS​.Temporal`
  `valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static CommonCRS​.Temporal[]`
  `values()`
  Returns an array containing the constants of this enum class, in the order they are declared.

  ### Methods inherited from class Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

  ### Methods inherited from class Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### JULIAN

    public static final CommonCRS.Temporal 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​.text` package uses the proleptic Julian calendar for dates before October 15, 1582, while the new date/time formatting classes in the `java​.time​.format` package use the ISO-8601 calendar system, which is equivalent to the proleptic Gregorian calendar for every dates. For parsing and formatting of Julian days, the `SimpleDateFormat` class is closer to the common practice (but not ISO 8601 compliant).

    See Also:
      - Julian day on Wikipedia

  - ### MODIFIED_JULIAN

    public static final CommonCRS.Temporal 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) as `MJD = JD − 2400000.5`. This variant was introduced by the Smithsonian Astrophysical Observatory (Massachusetts) in 1955.
    See Also:
      - Julian day on Wikipedia

  - ### TRUNCATED_JULIAN

    public static final CommonCRS.Temporal 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) as `TJD = JD − 2440000.5`. This variant was introduced by National Aeronautics and Space Administration (NASA) in 1979.
    See Also:
      - Julian day on Wikipedia

  - ### DUBLIN_JULIAN

    public static final CommonCRS.Temporal 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) as `DJD = JD − 2415020`. This variant was introduced by the International Astronomical Union (IAU) in 1955.
    See Also:
      - Julian day on Wikipedia

  - ### TROPICAL_YEAR

    public static final CommonCRS.Temporal TROPICAL_YEAR
    Time measured in units of tropical years since January 1, 2000 at 00:00 UTC. The length of a tropical year is defined by the International Union of Geological Sciences (IUGS) as exactly 31556925.445 seconds (approximately 365.24219 days) taken as the length of the tropical year in the year 2000. Apache SIS extends this definition by using January 1st, 2000 as the epoch (by contrast, the IUGS definition is only about duration).

    #### Application to geodesy

    The tropical year is the unit of measurement used in the EPSG geodetic dataset for year duration. It it used for rate of changes such as "centimeters per year". Its identifier is EPSG:1029.
    Since:
      1.5
    See Also:
      - `Units​.TROPICAL_YEAR`

  - ### UNIX

    public static final CommonCRS.Temporal UNIX
    Time measured as seconds since January 1st, 1970 at 00:00 UTC.

  - ### JAVA

    public static final CommonCRS.Temporal JAVA
    Time measured as milliseconds since January 1st, 1970 at 00:00 UTC.

- ## Method Details

  - ### values

    public static CommonCRS.Temporal[] values()
    Returns an array containing the constants of this enum class, in the order they are declared.
    Returns:
      an array containing the constants of this enum class, in the order they are declared

  - ### valueOf

    public static CommonCRS.Temporal valueOf(String name)
    Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      `NullPointerException` - if the argument is null

  - ### forIdentifier

    public static CommonCRS.Temporal forIdentifier(String identifier, boolean onlyOGC)
    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:
      - OGC Definitions Server

  - ### forEpoch

    @OptionalCandidate public static CommonCRS.Temporal forEpoch(Instant epoch)
    Returns the enumeration value for the given epoch, or `null` if none. If the epoch is January 1st, 1970, then this method returns `UNIX`.
    Parameters:
      `epoch` - the epoch for which to get an enumeration value, or `null`.
    Returns:
      the enumeration value for the given epoch, or `null` if none.
    Since:
      1.0

  - ### crs

    public 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_JULIAN`
    > Julian | `JULIAN`
    > Modified Julian | `MODIFIED_JULIAN`
    > Tropical year | `TROPICAL_YEAR`
    > Truncated Julian | `TRUNCATED_JULIAN`
    > Unix/POSIX | `UNIX`
    > Java `Date` | `JAVA`

    Returns:
      the CRS associated to this enum.
    See Also:
      - `DefaultTemporalCRS`

  - ### datum

    public 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_JULIAN`
    > Julian | `JULIAN`
    > Modified Julian | `MODIFIED_JULIAN`
    > Truncated Julian | `TRUNCATED_JULIAN`
    > Unix/POSIX or Java | `UNIX`

    Returns:
      the datum associated to this enum.
    See Also:
      - `DefaultTemporalDatum`