Package net.time4j.tz
Interface TransitionStrategy
public interface TransitionStrategy
Serves for resolving of local timestamps to a global UNIX timestamp, escpecially if there are conflicts due to gaps or overlaps on the local timeline.
Note: All implementations must be immutable and serializable.
- Author:
- Meno Hochschild
-
Method Summary
Modifier and TypeMethodDescriptiongetOffset(GregorianDate localDate, WallTime localTime, Timezone timezone)Calculates a suitable offset for given local timestamp.longresolve(GregorianDate localDate, WallTime localTime, Timezone timezone)Calculates a suitable global timestamp for given local timestamp.default TransitionStrategyusing(OverlapResolver resolver)Tries to change the overlap handling.
-
Method Details
-
resolve
Calculates a suitable global timestamp for given local timestamp.
The nanosecond fraction of given wall time will not be taken into account.
- Parameters:
localDate- local calendar date in given timezonelocalTime- local wall time in given timezonetimezone- timezone data containing offset history- Returns:
- global timestamp as full seconds since UNIX epoch (posix time)
- Since:
- 1.2.1
- See Also:
TimeScale.POSIX,PlainTimestamp.in(Timezone),Timezone.with(TransitionStrategy)
-
getOffset
Calculates a suitable offset for given local timestamp.
- Parameters:
localDate- local calendar date in given timezonelocalTime- local wall time in given timezonetimezone- timezone data containing offset history- Returns:
- ZonalOffset
- Since:
- 1.2.1
- See Also:
PlainTimestamp.in(Timezone),Timezone.with(TransitionStrategy)
-
using
Tries to change the overlap handling.
The default implementation does nothing.
- Parameters:
resolver- strategy how to handle ambivalent mappings during an offset overlap- Returns:
- possibly adjusted transition strategy
- Since:
- 3.32/4.27
-