uk.ac.starlink.table

## Class TimeDomain

- java.lang.Object
- - uk.ac.starlink.table.TimeDomain

- All Implemented Interfaces:
    Domain<TimeMapper>

      public class TimeDomain
      extends java.lang.Object
      implements Domain<TimeMapper>

  Domain representing epochs in a common time scale.

  The sole instance of this singleton class is available as the `INSTANCE` static member.

  Since:
    14 Apr 2020

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static TimeDomain` | `INSTANCE` Singleton instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getDomainName()` Returns the name of this domain.
    `TimeMapper[]` | `getMappers()` Returns a list of all mappers known to map values to this domain.
    `TimeMapper` | `getPossibleMapper(ValueInfo info)` Returns a typed DomainMapper that can be used for data described by the given metadata object.
    `TimeMapper` | `getProbableMapper(ValueInfo info)` Returns a typed DomainMapper that is likely to be appropriate for data described by the given metadata object.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### INSTANCE

          public static TimeDomain INSTANCE

      Singleton instance.

  - ### Method Detail

    - #### getDomainName

          public java.lang.String getDomainName()

      Description copied from interface: `Domain`
      Returns the name of this domain.
      Specified by:
        `getDomainName` in interface `Domain<TimeMapper>`
      Returns:
        domain name

    - #### getMappers

          public TimeMapper[] getMappers()

      Description copied from interface: `Domain`
      Returns a list of all mappers known to map values to this domain. This is not necessarily exhaustive, and may in particular not include mappers specific to certain input file formats, but it can be offered to users as a list of options for mapping to this domain where no other option is obvious.
      Specified by:
        `getMappers` in interface `Domain<TimeMapper>`
      Returns:
        list of generic mappers to this domain

    - #### getProbableMapper

          public TimeMapper getProbableMapper(ValueInfo info)

      Description copied from interface: `Domain`
      Returns a typed DomainMapper that is likely to be appropriate for data described by the given metadata object.

      In general, implementations of this method will first check the `ValueInfo.getDomainMappers()` method. If it is doubtful how to map from the given info to this domain, null should be returned.

      Specified by:
        `getProbableMapper` in interface `Domain<TimeMapper>`
      Parameters:
        `info` - metadata describing data to be mapped
      Returns:
        reliable guess at a suitable mapper

    - #### getPossibleMapper

          public TimeMapper getPossibleMapper(ValueInfo info)

      Description copied from interface: `Domain`
      Returns a typed DomainMapper that can be used for data described by the given metadata object. If some reasonable way to make the conversion exists, an appropriate value should be returned, but it's quite possible the conversion will be incorrect. If there is no known possible or plausible mapper, null should be returned.

      If the result of `Domain.getProbableMapper(uk.ac.starlink.table.ValueInfo)` is non-null, then this method must also return non-null, but this method is not required to return the same value as `getProbableMapper`.

      Specified by:
        `getPossibleMapper` in interface `Domain<TimeMapper>`
      Parameters:
        `info` - metadata describing data to be mapped
      Returns:
        best-efforts guess at a suitable mapper

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`