Class 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
    Author:
    Mark Taylor
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static TimeDomain INSTANCE
      Singleton instance.
    • 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