org.joda.time.tz
Class CachedDateTimeZone
- Serializable
public class CachedDateTimeZone
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.
boolean | equals(Object obj) - Compare this datetime zone with another.
|
static CachedDateTimeZone | forZone(DateTimeZone zone) - Returns a new CachedDateTimeZone unless given zone is already cached.
|
String | getNameKey(long instant) - Returns a non-localized name that is unique to this time zone.
|
int | getOffset(long instant) - Gets the millisecond offset to add to UTC to get local time.
|
int | getStandardOffset(long instant) - Gets the standard millisecond offset to add to UTC to get local time,
when standard time is in effect.
|
DateTimeZone | getUncachedZone() - Returns the DateTimeZone being wrapped.
|
int | hashCode() - Gets a hash code compatable with equals.
|
boolean | isFixed() - Returns true if this time zone has no transitions.
|
long | nextTransition(long instant) - Advances the given instant to where the time zone offset or name changes.
|
long | previousTransition(long instant) - Retreats the given instant to where the time zone offset or name changes.
|
convertLocalToUTC , convertUTCToLocal , equals , forID , forOffsetHours , forOffsetHoursMinutes , forOffsetMillis , forTimeZone , getAvailableIDs , getDefault , getID , getMillisKeepLocal , getName , getName , getNameKey , getNameProvider , getOffset , getOffset , getOffsetFromLocal , getProvider , getShortName , getShortName , getStandardOffset , hashCode , isFixed , isLocalDateTimeGap , isStandardOffset , nextTransition , previousTransition , setDefault , setNameProvider , setProvider , toString , toTimeZone , writeReplace |
equals
public boolean equals(Object obj)
Compare this datetime zone with another.
- equals in interface DateTimeZone
- true if equal, based on the ID and all internal rules
getNameKey
public String getNameKey(long instant)
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.
- getNameKey in interface DateTimeZone
instant
- milliseconds from 1970-01-01T00:00:00Z to get the name for
- name key or null if id should be used for names
getOffset
public int getOffset(long instant)
Gets the millisecond offset to add to UTC to get local time.
- getOffset in interface DateTimeZone
instant
- milliseconds from 1970-01-01T00:00:00Z to get the offset for
- the millisecond offset to add to UTC to get local time
getStandardOffset
public int getStandardOffset(long instant)
Gets the standard millisecond offset to add to UTC to get local time,
when standard time is in effect.
- getStandardOffset in interface DateTimeZone
instant
- milliseconds from 1970-01-01T00:00:00Z to get the offset for
- the millisecond offset to add to UTC to get local time
getUncachedZone
public DateTimeZone getUncachedZone()
Returns the DateTimeZone being wrapped.
hashCode
public int hashCode()
Gets a hash code compatable with equals.
- hashCode in interface DateTimeZone
isFixed
public boolean isFixed()
Returns true if this time zone has no transitions.
- isFixed in interface DateTimeZone
nextTransition
public long nextTransition(long instant)
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.
- nextTransition in interface DateTimeZone
instant
- milliseconds from 1970-01-01T00:00:00Z
- milliseconds from 1970-01-01T00:00:00Z
previousTransition
public long previousTransition(long instant)
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.
- previousTransition in interface DateTimeZone
instant
- milliseconds from 1970-01-01T00:00:00Z
- milliseconds from 1970-01-01T00:00:00Z
Copyright (c) 2001-2006 - Joda.org