public final class FastHttpDateFormat
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static int |
CACHE_SIZE |
protected static java.lang.String |
currentDate
Current formatted date.
|
protected static java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.String> |
formatCache
Formatter cache.
|
protected static java.lang.ThreadLocal |
FORMATS
ThreadLocal for the set of SimpleDateFormat formats to use in getDateHeader().
|
protected static java.util.TimeZone |
GMT_TIME_ZONE |
protected static long |
nextGeneration
Instant on which the currentDate object was generated.
|
protected static java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Long> |
parseCache
Parser cache.
|
| Constructor and Description |
|---|
FastHttpDateFormat() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
formatDate(long value,
java.text.DateFormat threadLocalFormat)
Get the HTTP format of the specified date.
http spec only requre second precision http://tools.ietf.org/html/rfc2616#page-20 therefore we dont use the millisecond precision , but second . |
static java.lang.String |
getCurrentDate()
Get the current date in HTTP format.
|
static long |
parseDate(java.lang.String value,
java.text.DateFormat[] threadLocalformats)
Try to parse the given date as a HTTP date.
|
protected static final int CACHE_SIZE
protected static final java.util.TimeZone GMT_TIME_ZONE
protected static final java.lang.ThreadLocal FORMATS
protected static volatile long nextGeneration
protected static volatile java.lang.String currentDate
protected static final java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.String> formatCache
protected static final java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Long> parseCache
public static java.lang.String getCurrentDate()
public static java.lang.String formatDate(long value,
java.text.DateFormat threadLocalFormat)
value - in milli-secondsthreadLocalFormat - the DateFormat used if cache value was
not foundpublic static long parseDate(java.lang.String value,
java.text.DateFormat[] threadLocalformats)
Copyright © 2014 Oracle Corporation. All Rights Reserved.