|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.joda.time.DateTimeZone org.joda.time.tz.CachedDateTimeZone
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.
Field Summary |
---|
Fields inherited from class org.joda.time.DateTimeZone |
---|
UTC |
Method Summary | |
---|---|
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. |
Methods inherited from class org.joda.time.DateTimeZone |
---|
adjustOffset, convertLocalToUTC, convertLocalToUTC, convertUTCToLocal, forID, forOffsetHours, forOffsetHoursMinutes, forOffsetMillis, forTimeZone, getAvailableIDs, getDefault, getID, getMillisKeepLocal, getName, getName, getNameProvider, getOffset, getOffsetFromLocal, getProvider, getShortName, getShortName, isLocalDateTimeGap, isStandardOffset, setDefault, setNameProvider, setProvider, toString, toTimeZone, writeReplace |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static CachedDateTimeZone forZone(DateTimeZone zone)
public DateTimeZone getUncachedZone()
public String getNameKey(long instant)
DateTimeZone
getNameKey
in class DateTimeZone
instant
- milliseconds from 1970-01-01T00:00:00Z to get the name for
public int getOffset(long instant)
DateTimeZone
getOffset
in class DateTimeZone
instant
- milliseconds from 1970-01-01T00:00:00Z to get the offset for
public int getStandardOffset(long instant)
DateTimeZone
getStandardOffset
in class DateTimeZone
instant
- milliseconds from 1970-01-01T00:00:00Z to get the offset for
public boolean isFixed()
DateTimeZone
isFixed
in class DateTimeZone
public long nextTransition(long instant)
DateTimeZone
nextTransition
in class DateTimeZone
instant
- milliseconds from 1970-01-01T00:00:00Z
public long previousTransition(long instant)
DateTimeZone
previousTransition
in class DateTimeZone
instant
- milliseconds from 1970-01-01T00:00:00Z
public int hashCode()
DateTimeZone
hashCode
in class DateTimeZone
public boolean equals(Object obj)
DateTimeZone
equals
in class DateTimeZone
obj
- the object to compare with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |