Class DateUtils.DefaultCalendarThreadLocal

  • Enclosing class:
    DateUtils

    public static final class DateUtils.DefaultCalendarThreadLocal
    extends java.lang.ThreadLocal<java.util.Calendar>
    Calendar objects are rather expensive: for heavy usage it's a good idea to use a single instance per thread instead of calling Calendar.getInstance() multiple times. Calendar.getInstance() creates a new instance each time.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.Calendar initialValue()  
      • Methods inherited from class java.lang.ThreadLocal

        get, remove, set, withInitial
      • Methods inherited from class java.lang.Object

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

      • DefaultCalendarThreadLocal

        public DefaultCalendarThreadLocal()
    • Method Detail

      • initialValue

        protected java.util.Calendar initialValue()
        Overrides:
        initialValue in class java.lang.ThreadLocal<java.util.Calendar>