Package org.joda.time.tz
Class DateTimeZoneBuilder.PrecalculatedZone
- java.lang.Object
-
- org.joda.time.DateTimeZone
-
- org.joda.time.tz.DateTimeZoneBuilder.PrecalculatedZone
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- DateTimeZoneBuilder
private static final class DateTimeZoneBuilder.PrecalculatedZone extends DateTimeZone
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]iNameKeysprivate int[]iStandardOffsetsprivate DateTimeZoneBuilder.DSTZoneiTailZoneprivate long[]iTransitionsprivate int[]iWallOffsetsprivate static longserialVersionUID-
Fields inherited from class org.joda.time.DateTimeZone
UTC
-
-
Constructor Summary
Constructors Modifier Constructor Description privatePrecalculatedZone(java.lang.String id, long[] transitions, int[] wallOffsets, int[] standardOffsets, java.lang.String[] nameKeys, DateTimeZoneBuilder.DSTZone tailZone)Constructor used ONLY for valid input, loaded via static methods.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static DateTimeZoneBuilder.PrecalculatedZonecreate(java.lang.String id, boolean outputID, java.util.ArrayList<DateTimeZoneBuilder.Transition> transitions, DateTimeZoneBuilder.DSTZone tailZone)Factory to create instance from builder.booleanequals(java.lang.Object obj)Compare this datetime zone with another.java.lang.StringgetNameKey(long instant)Returns a non-localized name that is unique to this time zone.intgetOffset(long instant)Gets the millisecond offset to add to UTC to get local time.intgetStandardOffset(long instant)Gets the standard millisecond offset to add to UTC to get local time, when standard time is in effect.booleanisCachable()booleanisFixed()Returns true if this time zone has no transitions.longnextTransition(long instant)Advances the given instant to where the time zone offset or name changes.longpreviousTransition(long instant)Retreats the given instant to where the time zone offset or name changes.(package private) static DateTimeZoneBuilder.PrecalculatedZonereadFrom(java.io.DataInput in, java.lang.String id)voidwriteTo(java.io.DataOutput out)-
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, hashCode, isLocalDateTimeGap, isStandardOffset, setDefault, setNameProvider, setProvider, toString, toTimeZone, writeReplace
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
iTransitions
private final long[] iTransitions
-
iWallOffsets
private final int[] iWallOffsets
-
iStandardOffsets
private final int[] iStandardOffsets
-
iNameKeys
private final java.lang.String[] iNameKeys
-
iTailZone
private final DateTimeZoneBuilder.DSTZone iTailZone
-
-
Constructor Detail
-
PrecalculatedZone
private PrecalculatedZone(java.lang.String id, long[] transitions, int[] wallOffsets, int[] standardOffsets, java.lang.String[] nameKeys, DateTimeZoneBuilder.DSTZone tailZone)Constructor used ONLY for valid input, loaded via static methods.
-
-
Method Detail
-
readFrom
static DateTimeZoneBuilder.PrecalculatedZone readFrom(java.io.DataInput in, java.lang.String id) throws java.io.IOException
- Throws:
java.io.IOException
-
create
static DateTimeZoneBuilder.PrecalculatedZone create(java.lang.String id, boolean outputID, java.util.ArrayList<DateTimeZoneBuilder.Transition> transitions, DateTimeZoneBuilder.DSTZone tailZone)
Factory to create instance from builder.- Parameters:
id- the zone idoutputID- true if the zone id should be outputtransitions- the list of Transition objectstailZone- optional zone for getting info beyond precalculated tables
-
getNameKey
public java.lang.String getNameKey(long instant)
Description copied from class:DateTimeZoneReturns 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.- Specified by:
getNameKeyin classDateTimeZone- Parameters:
instant- milliseconds from 1970-01-01T00:00:00Z to get the name for- Returns:
- name key or null if id should be used for names
-
getOffset
public int getOffset(long instant)
Description copied from class:DateTimeZoneGets the millisecond offset to add to UTC to get local time.- Specified by:
getOffsetin classDateTimeZone- Parameters:
instant- milliseconds from 1970-01-01T00:00:00Z to get the offset for- Returns:
- the millisecond offset to add to UTC to get local time
-
getStandardOffset
public int getStandardOffset(long instant)
Description copied from class:DateTimeZoneGets the standard millisecond offset to add to UTC to get local time, when standard time is in effect.- Specified by:
getStandardOffsetin classDateTimeZone- Parameters:
instant- milliseconds from 1970-01-01T00:00:00Z to get the offset for- Returns:
- the millisecond offset to add to UTC to get local time
-
isFixed
public boolean isFixed()
Description copied from class:DateTimeZoneReturns true if this time zone has no transitions.- Specified by:
isFixedin classDateTimeZone- Returns:
- true if no transitions
-
nextTransition
public long nextTransition(long instant)
Description copied from class:DateTimeZoneAdvances 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.- Specified by:
nextTransitionin classDateTimeZone- Parameters:
instant- milliseconds from 1970-01-01T00:00:00Z- Returns:
- milliseconds from 1970-01-01T00:00:00Z
-
previousTransition
public long previousTransition(long instant)
Description copied from class:DateTimeZoneRetreats 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.- Specified by:
previousTransitionin classDateTimeZone- Parameters:
instant- milliseconds from 1970-01-01T00:00:00Z- Returns:
- milliseconds from 1970-01-01T00:00:00Z
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:DateTimeZoneCompare this datetime zone with another.- Specified by:
equalsin classDateTimeZone- Parameters:
obj- the object to compare with- Returns:
- true if equal, based on the ID and all internal rules
-
writeTo
public void writeTo(java.io.DataOutput out) throws java.io.IOException- Throws:
java.io.IOException
-
isCachable
public boolean isCachable()
-
-