Class RelativeTimePatternConverter.CachedTimestamp

  • Enclosing class:
    RelativeTimePatternConverter

    private static final class RelativeTimePatternConverter.CachedTimestamp
    extends java.lang.Object
    Cached timestamp and formatted value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String formatted
      Cached formatted timestamp.
      private long timestamp
      Cached timestamp.
    • Constructor Summary

      Constructors 
      Constructor Description
      CachedTimestamp​(long timestamp, java.lang.String formatted)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean format​(long newTimestamp, java.lang.StringBuffer toAppendTo)
      Appends the cached formatted timestamp to the buffer if timestamps match.
      • Methods inherited from class java.lang.Object

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

      • timestamp

        private final long timestamp
        Cached timestamp.
      • formatted

        private final java.lang.String formatted
        Cached formatted timestamp.
    • Constructor Detail

      • CachedTimestamp

        public CachedTimestamp​(long timestamp,
                               java.lang.String formatted)
        Creates a new instance.
        Parameters:
        timestamp - timestamp.
        formatted - formatted timestamp.
    • Method Detail

      • format

        public boolean format​(long newTimestamp,
                              java.lang.StringBuffer toAppendTo)
        Appends the cached formatted timestamp to the buffer if timestamps match.
        Parameters:
        newTimestamp - requested timestamp.
        toAppendTo - buffer to append formatted timestamp.
        Returns:
        true if requested timestamp matched cached timestamp.