Top Fields Constructors Methods
com.ibm.icu.impl.duration

pack-priv abstract Class PeriodBuilderImpl

Located in compilation unit of com.ibm.icu.impl.duration.BasicPeriodBuilderFactory.

extends Object
implements PeriodBuilder
Class Inheritance
All Implemented Interfaces
com.ibm.icu.impl.duration.PeriodBuilder
Known Direct Subclasses
com.ibm.icu.impl.duration.FixedUnitBuilder, com.ibm.icu.impl.duration.SingleUnitBuilder, com.ibm.icu.impl.duration.OneOrTwoUnitBuilder, com.ibm.icu.impl.duration.MultiUnitBuilder

Field Summary

Modifier and TypeField and Description
protected BasicPeriodBuilderFactory.Settings

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public long
public Period
create(long
the duration in milliseconds from the current time to the target time. A negative duration indicates a time in the past
duration
)

Implements com.ibm.icu.impl.duration.PeriodBuilder.create.

Create a period of the given duration using the current system time as the reference time.
public Period
createWithReferenceDate(long
the duration in milliseconds from the referenced time to the target time. A negative duration indicates a time before the reference time
duration
,
long
the reference date from which to compute the period
referenceDate
)

Implements com.ibm.icu.impl.duration.PeriodBuilder.createWithReferenceDate.

Create a period of the given duration using the provided reference date.
protected abstract Period
handleCreate(long duration, long referenceDate, boolean inPast)

public PeriodBuilder
withLocale(String localeName)

Implements com.ibm.icu.impl.duration.PeriodBuilder.withLocale.

Returns a new PeriodBuilder that uses the provided locale to determine what periods are available for use.
protected abstract PeriodBuilder
public PeriodBuilder
withTimeZone(TimeZone timeZone)

Implements com.ibm.icu.impl.duration.PeriodBuilder.withTimeZone.

Returns a new PeriodBuilder that computes periods starting at dates in the provided time zone.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

settingsback to summary
protected BasicPeriodBuilderFactory.Settings settings

Constructor Detail

PeriodBuilderImplback to summary
protected PeriodBuilderImpl(BasicPeriodBuilderFactory.Settings settings)

Method Detail

approximateDurationOfback to summary
public long approximateDurationOf(TimeUnit unit)
createback to summary
public Period create(long duration)

Implements com.ibm.icu.impl.duration.PeriodBuilder.create.

Doc from com.ibm.icu.impl.duration.PeriodBuilder.create.

Create a period of the given duration using the current system time as the reference time.

Parameters
duration:long

the duration in milliseconds from the current time to the target time. A negative duration indicates a time in the past

Returns:Period

a Period that represents the duration

Annotations
@Override
createWithReferenceDateback to summary
public Period createWithReferenceDate(long duration, long referenceDate)

Implements com.ibm.icu.impl.duration.PeriodBuilder.createWithReferenceDate.

Doc from com.ibm.icu.impl.duration.PeriodBuilder.createWithReferenceDate.

Create a period of the given duration using the provided reference date.

Parameters
duration:long

the duration in milliseconds from the referenced time to the target time. A negative duration indicates a time before the reference time

referenceDate:long

the reference date from which to compute the period

Returns:Period

a Period that represents the duration

Annotations
@Override
handleCreateback to summary
protected abstract Period handleCreate(long duration, long referenceDate, boolean inPast)
withLocaleback to summary
public PeriodBuilder withLocale(String localeName)

Implements com.ibm.icu.impl.duration.PeriodBuilder.withLocale.

Doc from com.ibm.icu.impl.duration.PeriodBuilder.withLocale.

Returns a new PeriodBuilder that uses the provided locale to determine what periods are available for use.

Annotations
@Override
withSettingsback to summary
protected abstract PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse)
withTimeZoneback to summary
public PeriodBuilder withTimeZone(TimeZone timeZone)

Implements com.ibm.icu.impl.duration.PeriodBuilder.withTimeZone.

Doc from com.ibm.icu.impl.duration.PeriodBuilder.withTimeZone.

Returns a new PeriodBuilder that computes periods starting at dates in the provided time zone.

Annotations
@Override