java.lang.Object
org.joda.time.DateTimeZone
org.joda.time.tz.CachedDateTimeZone
- All Implemented Interfaces:
- java.io.Serializable
- public class CachedDateTimeZone
- extends org.joda.time.DateTimeZone
Improves the performance of requesting time zone offsets and name keys by
caching the results. Time zones that have simple rules or are fixed should
not be cached, as it is unlikely to improve performance.
CachedDateTimeZone is thread-safe and immutable.
- Since:
- 1.0
| Nested classes inherited from class org.joda.time.DateTimeZone |
|
| Methods inherited from class org.joda.time.DateTimeZone |
forID, forOffsetHours, forOffsetHoursMinutes, forOffsetMillis, forTimeZone, getAvailableIDs, getDefault, getID, getMillisKeepLocal, getName, getName, getNameProvider, getOffset, getOffsetFromLocal, getProvider, getShortName, getShortName, setDefault, setNameProvider, setProvider, toString, toTimeZone, writeReplace |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
cInfoCacheMask
private static final int cInfoCacheMask
iZone
private final org.joda.time.DateTimeZone iZone
iInfoCache
private transient CachedDateTimeZone.Info[] iInfoCache
CachedDateTimeZone
private CachedDateTimeZone(org.joda.time.DateTimeZone zone)
forZone
public static CachedDateTimeZone forZone(org.joda.time.DateTimeZone zone)
- Returns a new CachedDateTimeZone unless given zone is already cached.
readObject
private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
getUncachedZone
public org.joda.time.DateTimeZone getUncachedZone()
- Returns the DateTimeZone being wrapped.
getNameKey
public java.lang.String getNameKey(long instant)
- Description copied from class:
org.joda.time.DateTimeZone
- Returns a non-localized name that is unique to this time zone. It can be
combined with id to form a unique key for fetching localized names.
getOffset
public int getOffset(long instant)
- Description copied from class:
org.joda.time.DateTimeZone
- Gets the millisecond offset to add to UTC to get local time.
getStandardOffset
public int getStandardOffset(long instant)
- Description copied from class:
org.joda.time.DateTimeZone
- Gets the standard millisecond offset to add to UTC to get local time,
when standard time is in effect.
isFixed
public boolean isFixed()
- Description copied from class:
org.joda.time.DateTimeZone
- Returns true if this time zone has no transitions.
nextTransition
public long nextTransition(long instant)
- Description copied from class:
org.joda.time.DateTimeZone
- Advances the given instant to where the time zone offset or name changes.
If the instant returned is exactly the same as passed in, then
no changes occur after the given instant.
previousTransition
public long previousTransition(long instant)
- Description copied from class:
org.joda.time.DateTimeZone
- Retreats the given instant to where the time zone offset or name changes.
If the instant returned is exactly the same as passed in, then
no changes occur before the given instant.
hashCode
public int hashCode()
- Description copied from class:
org.joda.time.DateTimeZone
- Gets a hash code compatable with equals.
equals
public boolean equals(java.lang.Object obj)
- Description copied from class:
org.joda.time.DateTimeZone
- Compare this datetime zone with another.
getInfo
private CachedDateTimeZone.Info getInfo(long millis)
createInfo
private CachedDateTimeZone.Info createInfo(long millis)