Class TimeUtils


  • public class TimeUtils
    extends Object
    Time-related utilities.
    Since:
    14.0
    Author:
    Luc Maisonobe
    • Method Detail

      • earliest

        public static <S extends TimeStamped> S earliest​(S ts1,
                                                         S ts2)
        Get the earliest object from a pair.
        Type Parameters:
        S - type of the time stamped objects
        Parameters:
        ts1 - first object
        ts2 - second object
        Returns:
        the earliest occurring object among #@code ts1} and ts2
      • earliest

        public static <T extends CalculusFieldElement<T>,​S extends FieldTimeStamped<T>> S earliest​(S ts1,
                                                                                                         S ts2)
        Get the earliest object from a pair.
        Type Parameters:
        T - type of the field elements
        S - type of the time stamped objects
        Parameters:
        ts1 - first object
        ts2 - second object
        Returns:
        the earliest occurring object among #@code ts1} and ts2
      • latest

        public static <S extends TimeStamped> S latest​(S ts1,
                                                       S ts2)
        Get the earliest object from a pair.
        Type Parameters:
        S - type of the time stamped objects
        Parameters:
        ts1 - first object
        ts2 - second object
        Returns:
        the earliest occurring object among #@code ts1} and ts2
      • latest

        public static <T extends CalculusFieldElement<T>,​S extends FieldTimeStamped<T>> S latest​(S ts1,
                                                                                                       S ts2)
        Get the earliest object from a pair.
        Type Parameters:
        T - type of the field elements
        S - type of the time stamped objects
        Parameters:
        ts1 - first object
        ts2 - second object
        Returns:
        the earliest occurring object among #@code ts1} and ts2