Class CascadeComparisonDateTool


  • public class CascadeComparisonDateTool
    extends org.apache.velocity.tools.generic.ComparisonDateTool
    Extension of ComparisonDateTool that implements Cascade User friendly date methods.
    Since:
    6.2
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.velocity.tools.generic.ComparisonDateTool

        org.apache.velocity.tools.generic.ComparisonDateTool.Comparison
    • Field Summary

      • Fields inherited from class org.apache.velocity.tools.generic.ComparisonDateTool

        ABBR_SUFFIX, AFTER_KEY, BEFORE_KEY, BUNDLE_NAME_KEY, CURRENT_PREFIX, CURRENT_TYPE, DAY_KEY, DEFAULT_BUNDLE_NAME, DEPTH_KEY, DIFF_TYPE, EQUAL_KEY, HOUR_KEY, MILLIS_PER_DAY, MILLIS_PER_HOUR, MILLIS_PER_MINUTE, MILLIS_PER_MONTH, MILLIS_PER_SECOND, MILLIS_PER_WEEK, MILLIS_PER_YEAR, MILLISECOND_KEY, MINUTE_KEY, MONTH_KEY, ONE_DAY_SUFFIX, PLURAL_SUFFIX, RELATIVE_TYPE, SECOND_KEY, SKIPPED_UNITS_KEY, TIME_UNITS, WEEK_KEY, YEAR_KEY, ZERO_KEY
      • Fields inherited from class org.apache.velocity.tools.generic.DateTool

        DEFAULT_FORMAT_KEY, DEFAULT_LOCALE_KEY, TIMEZONE_KEY
      • Fields inherited from class org.apache.velocity.tools.generic.FormatConfig

        DEFAULT_FORMAT, FORMAT_KEY
      • Fields inherited from class org.apache.velocity.tools.generic.LocaleConfig

        DEFAULT_LOCALE
      • Fields inherited from class org.apache.velocity.tools.generic.SafeConfig

        LOCK_CONFIG_KEY, OLD_LOCK_CONFIG_KEY, SAFE_MODE_KEY
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.velocity.tools.generic.ComparisonDateTool.Comparison difference​(java.lang.Object now, java.lang.Object then)  
      java.util.Calendar getCalendar()  
      java.util.Date getDate()  
      java.util.Date getDate​(java.lang.String dateStr)  
      java.lang.Integer getDay()  
      java.lang.Integer getDay​(java.lang.Object date)  
      java.lang.Integer getMonth()  
      java.lang.Integer getMonth​(java.lang.Object date)  
      long getTime()  
      java.lang.Integer getValue​(java.lang.Integer integer, java.lang.Object date)  
      java.lang.Integer getYear()  
      java.lang.Integer getYear​(java.lang.Object date)  
      static long toDays​(long ms)  
      static long toHours​(long ms)  
      static long toMinutes​(long ms)  
      static long toMonths​(long ms)  
      static long toSeconds​(long ms)  
      static long toWeeks​(long ms)  
      static long toYears​(long ms)  
      org.apache.velocity.tools.generic.ComparisonDateTool.Comparison whenIs​(java.lang.Object then)  
      org.apache.velocity.tools.generic.ComparisonDateTool.Comparison whenIs​(java.lang.Object now, java.lang.Object then)  
      • Methods inherited from class org.apache.velocity.tools.generic.ComparisonDateTool

        compare, configure, getText, toString, toString
      • Methods inherited from class org.apache.velocity.tools.generic.DateTool

        format, format, format, format, format, format, format, get, get, getDateFormat, getDateFormat, getDateFormat, getStyleAsInt, getSystemCalendar, getSystemDate, getSystemTime, getTimeZone, getValue, getValue, getValue, setTimeZone, toCalendar, toCalendar, toDate, toDate, toDate, toDate, toString
      • Methods inherited from class org.apache.velocity.tools.generic.FormatConfig

        getFormat, setFormat
      • Methods inherited from class org.apache.velocity.tools.generic.LocaleConfig

        getLocale, setLocale
      • Methods inherited from class org.apache.velocity.tools.generic.SafeConfig

        configure, isConfigLocked, isSafeMode, setLockConfig, setSafeMode
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CascadeComparisonDateTool

        public CascadeComparisonDateTool()
    • Method Detail

      • getDate

        public java.util.Date getDate​(java.lang.String dateStr)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getValue

        public java.lang.Integer getValue​(java.lang.Integer integer,
                                          java.lang.Object date)
      • toYears

        public static long toYears​(long ms)
      • toMonths

        public static long toMonths​(long ms)
      • toWeeks

        public static long toWeeks​(long ms)
      • toDays

        public static long toDays​(long ms)
      • toHours

        public static long toHours​(long ms)
      • toMinutes

        public static long toMinutes​(long ms)
      • toSeconds

        public static long toSeconds​(long ms)
      • whenIs

        public org.apache.velocity.tools.generic.ComparisonDateTool.Comparison whenIs​(java.lang.Object then)
        Overrides:
        whenIs in class org.apache.velocity.tools.generic.ComparisonDateTool
      • whenIs

        public org.apache.velocity.tools.generic.ComparisonDateTool.Comparison whenIs​(java.lang.Object now,
                                                                                      java.lang.Object then)
        Overrides:
        whenIs in class org.apache.velocity.tools.generic.ComparisonDateTool
      • difference

        public org.apache.velocity.tools.generic.ComparisonDateTool.Comparison difference​(java.lang.Object now,
                                                                                          java.lang.Object then)
        Overrides:
        difference in class org.apache.velocity.tools.generic.ComparisonDateTool
      • getTime

        public long getTime()
      • getDate

        public java.util.Date getDate()
        Overrides:
        getDate in class org.apache.velocity.tools.generic.DateTool
      • getCalendar

        public java.util.Calendar getCalendar()
        Overrides:
        getCalendar in class org.apache.velocity.tools.generic.DateTool
      • getDay

        public java.lang.Integer getDay()
        Overrides:
        getDay in class org.apache.velocity.tools.generic.DateTool
      • getDay

        public java.lang.Integer getDay​(java.lang.Object date)
        Overrides:
        getDay in class org.apache.velocity.tools.generic.DateTool
      • getMonth

        public java.lang.Integer getMonth()
        Overrides:
        getMonth in class org.apache.velocity.tools.generic.DateTool
      • getMonth

        public java.lang.Integer getMonth​(java.lang.Object date)
        Overrides:
        getMonth in class org.apache.velocity.tools.generic.DateTool
      • getYear

        public java.lang.Integer getYear()
        Overrides:
        getYear in class org.apache.velocity.tools.generic.DateTool
      • getYear

        public java.lang.Integer getYear​(java.lang.Object date)
        Overrides:
        getYear in class org.apache.velocity.tools.generic.DateTool