org.geotoolkit.referencing.datum
Class DefaultTemporalDatum

Object
  extended by FormattableObject
      extended by AbstractIdentifiedObject
          extended by AbstractDatum
              extended by DefaultTemporalDatum
All Implemented Interfaces:
Serializable, Formattable, LenientComparable, Datum, TemporalDatum, IdentifiedObject

@Immutable
public class DefaultTemporalDatum
extends AbstractDatum
implements TemporalDatum

A temporal datum defines the origin of a temporal coordinate reference system.

Since:
1.2
Version:
3.19
Author:
Martin Desruisseaux (IRD, Geomatys)
See Also:
Serialized Form
Module:
referencing/geotk-referencing (download)    View source code for this class

Field Summary
static DefaultTemporalDatum DUBLIN_JULIAN
          Datum for time measured since December 31, 1899 at 12:00 UTC.
static DefaultTemporalDatum JULIAN
          Datum for time measured since January 1st, 4713 BC at 12:00 UTC.
static DefaultTemporalDatum MODIFIED_JULIAN
          Datum for time measured since November 17, 1858 at 00:00 UTC.
static DefaultTemporalDatum TRUNCATED_JULIAN
          Datum for time measured since May 24, 1968 at 00:00 UTC.
static DefaultTemporalDatum UNIX
          Default datum for time measured since January 1st, 1970 at 00:00 UTC.
 
Fields inherited from class FormattableObject
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE
 
Fields inherited from interface Datum
ANCHOR_POINT_KEY, DOMAIN_OF_VALIDITY_KEY, REALIZATION_EPOCH_KEY, SCOPE_KEY
 
Fields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
 
Constructor Summary
DefaultTemporalDatum(Map<String,?> properties, Date origin)
          Constructs a temporal datum from a set of properties.
DefaultTemporalDatum(String name, Date origin)
          Constructs a temporal datum from a name.
DefaultTemporalDatum(TemporalDatum datum)
          Constructs a new datum with the same values than the specified one.
 
Method Summary
static DefaultTemporalDatum castOrCopy(TemporalDatum object)
          Returns a Geotk datum implementation with the same values than the given arbitrary implementation.
protected  int computeHashCode()
          Computes a hash value for this identified object.
 boolean equals(Object object, ComparisonMode mode)
          Compares this temporal datum with the specified object for equality.
 Date getOrigin()
          The date and time origin of this temporal datum.
static DefaultTemporalDatum wrap(TemporalDatum object)
          Deprecated. Renamed castOrCopy.
 
Methods inherited from class AbstractDatum
formatWKT, getAnchorPoint, getDomainOfValidity, getRealizationEpoch, getScope
 
Methods inherited from class AbstractIdentifiedObject
equals, getAlias, getIdentifier, getIdentifiers, getName, getName, getRemarks, hashCode, nameMatches
 
Methods inherited from class FormattableObject
getDefaultIndentation, print, setDefaultIndentation, toString, toWKT, toWKT, toWKT
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface TemporalDatum
getAnchorPoint, getRealizationEpoch
 
Methods inherited from interface Datum
getDomainOfValidity, getScope
 
Methods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
 

Field Detail

JULIAN

public static final DefaultTemporalDatum JULIAN
Datum for time measured since January 1st, 4713 BC at 12:00 UTC.

Since:
2.5
See Also:
DefaultTemporalCRS.JULIAN

MODIFIED_JULIAN

public static final DefaultTemporalDatum MODIFIED_JULIAN
Datum for time measured 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.

Since:
2.5
See Also:
DefaultTemporalCRS.MODIFIED_JULIAN

TRUNCATED_JULIAN

public static final DefaultTemporalDatum TRUNCATED_JULIAN
Datum for time measured 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.

Since:
2.5
See Also:
DefaultTemporalCRS.TRUNCATED_JULIAN

DUBLIN_JULIAN

public static final DefaultTemporalDatum DUBLIN_JULIAN
Datum for time measured since December 31, 1899 at 12:00 UTC. A Dublin Julian day (DJD) is defined relative to Julian day (JD) as DJD = JD − 2415020.

Since:
2.5
See Also:
DefaultTemporalCRS.DUBLIN_JULIAN

UNIX

public static final DefaultTemporalDatum UNIX
Default datum for time measured since January 1st, 1970 at 00:00 UTC.

See Also:
DefaultTemporalCRS.UNIX, DefaultTemporalCRS.JAVA
Constructor Detail

DefaultTemporalDatum

public DefaultTemporalDatum(TemporalDatum datum)
Constructs a new datum with the same values than the specified one. This copy constructor provides a way to convert an arbitrary implementation into a Geotk one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. This constructor performs a shallow copy, i.e. the properties are not cloned.

Parameters:
datum - The datum to copy.
Since:
2.2

DefaultTemporalDatum

public DefaultTemporalDatum(String name,
                            Date origin)
Constructs a temporal datum from a name.

Parameters:
name - The datum name.
origin - The date and time origin of this temporal datum.

DefaultTemporalDatum

public DefaultTemporalDatum(Map<String,?> properties,
                            Date origin)
Constructs a temporal datum from a set of properties. The properties map is given unchanged to the super-class constructor.

Parameters:
properties - Set of properties. Should contains at least "name".
origin - The date and time origin of this temporal datum.
Method Detail

castOrCopy

public static DefaultTemporalDatum castOrCopy(TemporalDatum object)
Returns a Geotk datum implementation with the same values than the given arbitrary implementation. If the given object is null, then this method returns null. Otherwise if the given object is already a Geotk implementation, then the given object is returned unchanged. Otherwise a new Geotk implementation is created and initialized to the attribute values of the given object.

Parameters:
object - The object to get as a Geotk implementation, or null if none.
Returns:
A Geotk implementation containing the values of the given object (may be the given object itself), or null if the argument was null.
Since:
3.18

wrap

@Deprecated
public static DefaultTemporalDatum wrap(TemporalDatum object)
Deprecated. Renamed castOrCopy.

Parameters:
object - The object to get as a Geotk implementation, or null if none.
Returns:
The given object as a Geotk implementation.

getOrigin

public Date getOrigin()
The date and time origin of this temporal datum.

Specified by:
getOrigin in interface TemporalDatum
Returns:
The date and time origin of this temporal datum.

equals

public boolean equals(Object object,
                      ComparisonMode mode)
Compares this temporal datum with the specified object for equality.

Specified by:
equals in interface LenientComparable
Overrides:
equals in class AbstractDatum
Parameters:
object - The object to compare to this.
mode - STRICT for performing a strict comparison, or IGNORE_METADATA for comparing only properties relevant to transformations.
Returns:
true if both objects are equal.

computeHashCode

protected int computeHashCode()
Computes a hash value for this identified object. This method is invoked by AbstractIdentifiedObject.hashCode() when first needed.

Implementation specific feature
In the Geotk implementation, the name, identifiers and remarks are not used for hash code computation. Consequently two identified objects will return the same hash value if they are equal in the sense of equals(…, ComparisonMode.IGNORE_METADATA). This feature allows users to implement metadata-insensitive HashMap.

Overrides:
computeHashCode in class AbstractIdentifiedObject
Returns:
The hash code value. This value may change between different execution of the Geotk library.


Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.