Package com.ibm.icu.impl.duration
Class PeriodBuilderImpl
java.lang.Object
com.ibm.icu.impl.duration.PeriodBuilderImpl
- All Implemented Interfaces:
PeriodBuilder
- Direct Known Subclasses:
FixedUnitBuilder
,MultiUnitBuilder
,OneOrTwoUnitBuilder
,SingleUnitBuilder
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionlong
create
(long duration) Create a period of the given duration using the current system time as the reference time.createWithReferenceDate
(long duration, long referenceDate) Create a period of the given duration using the provided reference date.protected abstract Period
handleCreate
(long duration, long referenceDate, boolean inPast) withLocale
(String localeName) Returns a new PeriodBuilder that uses the provided locale to determine what periods are available for use.protected abstract PeriodBuilder
withSettings
(BasicPeriodBuilderFactory.Settings settingsToUse) withTimeZone
(TimeZone timeZone) Returns a new PeriodBuilder that computes periods starting at dates in the provided time zone.
-
Field Details
-
settings
-
-
Constructor Details
-
PeriodBuilderImpl
-
-
Method Details
-
create
Description copied from interface:PeriodBuilder
Create a period of the given duration using the current system time as the reference time.- Specified by:
create
in interfacePeriodBuilder
- Parameters:
duration
- the duration in milliseconds from the current time to the target time. A negative duration indicates a time in the past- Returns:
- a Period that represents the duration
-
approximateDurationOf
-
createWithReferenceDate
Description copied from interface:PeriodBuilder
Create a period of the given duration using the provided reference date.- Specified by:
createWithReferenceDate
in interfacePeriodBuilder
- Parameters:
duration
- the duration in milliseconds from the referenced time to the target time. A negative duration indicates a time before the reference timereferenceDate
- the reference date from which to compute the period- Returns:
- a Period that represents the duration
-
withTimeZone
Description copied from interface:PeriodBuilder
Returns a new PeriodBuilder that computes periods starting at dates in the provided time zone.- Specified by:
withTimeZone
in interfacePeriodBuilder
-
withLocale
Description copied from interface:PeriodBuilder
Returns a new PeriodBuilder that uses the provided locale to determine what periods are available for use.- Specified by:
withLocale
in interfacePeriodBuilder
-
withSettings
-
handleCreate
-