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 TypeMethodDescriptionlongcreate(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 PeriodhandleCreate(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 PeriodBuilderwithSettings(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:PeriodBuilderCreate a period of the given duration using the current system time as the reference time.- Specified by:
createin 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:PeriodBuilderCreate a period of the given duration using the provided reference date.- Specified by:
createWithReferenceDatein 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:PeriodBuilderReturns a new PeriodBuilder that computes periods starting at dates in the provided time zone.- Specified by:
withTimeZonein interfacePeriodBuilder
-
withLocale
Description copied from interface:PeriodBuilderReturns a new PeriodBuilder that uses the provided locale to determine what periods are available for use.- Specified by:
withLocalein interfacePeriodBuilder
-
withSettings
-
handleCreate
-