Class DefaultInstant

java.lang.Object
org.apache.sis.internal.temporal.DefaultInstant
All Implemented Interfaces:
Instant, org.opengis.temporal.TemporalPrimitive

final class DefaultInstant extends Object implements Instant
Default implementation of GeoAPI instant. This is a temporary class; GeoAPI temporal interfaces are expected to change a lot in a future revision.
Since:
1.2
Version:
1.2
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final long
    The date in milliseconds since epoch.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instant for the given date.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compares with given object for equality.
    Returns the date used for describing temporal position.
    int
    Hash code value of the time position.
    String representation in ISO format.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • millis

      private final long millis
      The date in milliseconds since epoch.
  • Constructor Details

    • DefaultInstant

      DefaultInstant(Date time)
      Creates a new instant for the given date.
  • Method Details

    • getDate

      public Date getDate()
      Returns the date used for describing temporal position.
      Specified by:
      getDate in interface Instant
      Returns:
      The date.
    • toString

      public String toString()
      String representation in ISO format.
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Hash code value of the time position.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Compares with given object for equality.
      Overrides:
      equals in class Object