public class

MockZone

extends DateTimeZone
java.lang.Object
   ↳ org.joda.time.DateTimeZone
     ↳ org.joda.time.MockZone

Summary

[Expand]
Inherited Fields
From class org.joda.time.DateTimeZone
Public Constructors
MockZone(long transition, int winterOffset)
Public Methods
boolean equals(Object object)
Compare this datetime zone with another.
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.
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.
[Expand]
Inherited Methods
From class org.joda.time.DateTimeZone
From class java.lang.Object

Public Constructors

public MockZone (long transition, int winterOffset)

Public Methods

public boolean equals (Object object)

Compare this datetime zone with another.

Parameters
object the object to compare with
Returns
  • true if equal, based on the ID and all internal rules

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.

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

public int getOffset (long instant)

Gets the millisecond offset to add to UTC to get local time.

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

public int getStandardOffset (long instant)

Gets the standard millisecond offset to add to UTC to get local time, when standard time is in effect.

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

public boolean isFixed ()

Returns true if this time zone has no transitions.

Returns
  • true if no transitions

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.

Parameters
instant milliseconds from 1970-01-01T00:00:00Z
Returns
  • milliseconds from 1970-01-01T00:00:00Z

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.

Parameters
instant milliseconds from 1970-01-01T00:00:00Z
Returns
  • milliseconds from 1970-01-01T00:00:00Z