Class Operators.RelativeDateOperator.TimePeriod

    • Constructor Detail

      • TimePeriod

        protected TimePeriod​(java.lang.String name)
    • Method Detail

      • getTimePeriodsAsString

        public static java.lang.String getTimePeriodsAsString()
      • match

        public static Operators.RelativeDateOperator.TimePeriod match​(java.lang.String name)
        Returns time period matching with the input string.
        Parameters:
        name - the name of time period.
        Returns:
        The TimePeriod when the name matches, null when the name is null or empty or no matching is found.
      • isMatching

        protected boolean isMatching​(java.lang.String name)
        Returns whether the input name matches with the time period. The actual implementation returns true when the time periods name starts with the input string. It is case insensitive.
        Parameters:
        name - The string to match with time period.
        Returns:
        True when the input String matches with the time period.
      • calculateDate

        public abstract java.util.Date calculateDate​(int before)
        Calculates a date from the before time and the actual date.
        Parameters:
        before - The number of units to subtract from current time.
        Returns:
        The date before.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object