Class CachingDateFormatter


  • public class CachingDateFormatter
    extends java.lang.Object
    A synchronized implementation of SimpleDateFormat which uses caching internally.
    Since:
    0.9.29
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.String cachedStr  
      (package private) long lastTimestamp  
      (package private) java.text.SimpleDateFormat sdf  
    • Constructor Summary

      Constructors 
      Constructor Description
      CachingDateFormatter​(java.lang.String pattern)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(long now)  
      void setTimeZone​(java.util.TimeZone tz)  
      • Methods inherited from class java.lang.Object

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

      • lastTimestamp

        long lastTimestamp
      • cachedStr

        java.lang.String cachedStr
      • sdf

        final java.text.SimpleDateFormat sdf
    • Constructor Detail

      • CachingDateFormatter

        public CachingDateFormatter​(java.lang.String pattern)
    • Method Detail

      • format

        public final java.lang.String format​(long now)
      • setTimeZone

        public void setTimeZone​(java.util.TimeZone tz)