Class TimeStampFactory

  • All Implemented Interfaces:
    TimeStamp

    public class TimeStampFactory
    extends Object
    implements TimeStamp
    An implementation of TimeStamp.
    Author:
    mrk
    • Constructor Detail

      • TimeStampFactory

        public TimeStampFactory()
    • Method Detail

      • create

        public static TimeStamp create()
        Create an instance of a timeStamp.
        Returns:
        the interface
      • getUserTag

        public int getUserTag()
        Description copied from interface: TimeStamp
        Get the userTag.
        Specified by:
        getUserTag in interface TimeStamp
        Returns:
        the userTag
      • setUserTag

        public void setUserTag​(int userTag)
        Description copied from interface: TimeStamp
        set the userTag.
        Specified by:
        setUserTag in interface TimeStamp
        Parameters:
        userTag - the value for the userTag
      • add

        public void add​(double seconds)
        Description copied from interface: TimeStamp
        Add the number of seconds.
        Specified by:
        add in interface TimeStamp
        Parameters:
        seconds - the number of seconds to add
      • add

        public void add​(long seconds)
        Description copied from interface: TimeStamp
        Add the number of seconds.
        Specified by:
        add in interface TimeStamp
        Parameters:
        seconds - the number of seconds to add
      • diff

        public double diff​(TimeStamp a,
                           TimeStamp b)
        Description copied from interface: TimeStamp
        Get the difference, i.e. a-b
        Specified by:
        diff in interface TimeStamp
        Parameters:
        a - the first value
        b - the second value
        Returns:
        a-b
      • equals

        public boolean equals​(TimeStamp other)
        Description copied from interface: TimeStamp
        Does this timeStamp have the same time as the other?
        Specified by:
        equals in interface TimeStamp
        Parameters:
        other - the other timeStamp
        Returns:
        (false,true) if (not same, same)
      • le

        public boolean le​(TimeStamp other)
        Description copied from interface: TimeStamp
        Is the time for this timeStamp earlier than or equal to the other.
        Specified by:
        le in interface TimeStamp
        Parameters:
        other - the other timeStamp
        Returns:
        (false,true) if (not less or equal, less or equal))
      • lt

        public boolean lt​(TimeStamp other)
        Description copied from interface: TimeStamp
        Is the time for this timeStamp earlier than for the other?
        Specified by:
        lt in interface TimeStamp
        Parameters:
        other - the other timeStamp
        Returns:
        (false,true) if (not less, less)
      • getEpicsSecondsPastEpoch

        public long getEpicsSecondsPastEpoch()
        Description copied from interface: TimeStamp
        Get the number of seconds since the January 1, 1990, 00:00:00 UTC
        Specified by:
        getEpicsSecondsPastEpoch in interface TimeStamp
        Returns:
        the number of seconds
      • getMilliSeconds

        public long getMilliSeconds()
        Description copied from interface: TimeStamp
        Get the number of milliSeconds since the January 1, 1970, 00:00:00 UTC
        Specified by:
        getMilliSeconds in interface TimeStamp
        Returns:
        the number
      • getNanoseconds

        public int getNanoseconds()
        Description copied from interface: TimeStamp
        Get the number of nanoseconds within the second.
        Specified by:
        getNanoseconds in interface TimeStamp
        Returns:
        the number
      • getSecondsPastEpoch

        public long getSecondsPastEpoch()
        Description copied from interface: TimeStamp
        Get the number of seconds since the January 1, 1970, 00:00:00 UTC
        Specified by:
        getSecondsPastEpoch in interface TimeStamp
        Returns:
        the number of seconds
      • normalize

        public void normalize()
        Description copied from interface: TimeStamp
        Adjust secs and nanoseconds so that 0<=nanoseconds<nanoSecPerSec
        Specified by:
        normalize in interface TimeStamp
      • put

        public void put​(long secondsPastEpoch,
                        int nanoseconds)
        Description copied from interface: TimeStamp
        Put the time.
        Specified by:
        put in interface TimeStamp
        Parameters:
        secondsPastEpoch - the number of seconds since January 1, 1970, 00:00:00 UTC
        nanoseconds - the number of nanoseconds within the second
      • put

        public void put​(long milliSeconds)
        Description copied from interface: TimeStamp
        Put the time in milliSeconds since January 1, 1970, 00:00:00 UTC
        Specified by:
        put in interface TimeStamp
        Parameters:
        milliSeconds - the number of milliSeconds
      • getCurrentTime

        public void getCurrentTime()
        Description copied from interface: TimeStamp
        Get the current time.
        Specified by:
        getCurrentTime in interface TimeStamp