Class PeriodBuilderImpl

java.lang.Object
com.ibm.icu.impl.duration.PeriodBuilderImpl
All Implemented Interfaces:
PeriodBuilder
Direct Known Subclasses:
FixedUnitBuilder, MultiUnitBuilder, OneOrTwoUnitBuilder, SingleUnitBuilder

abstract class PeriodBuilderImpl extends Object implements PeriodBuilder
  • Field Details

  • Constructor Details

  • Method Details

    • create

      public Period create(long duration)
      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 interface PeriodBuilder
      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

      public long approximateDurationOf(TimeUnit unit)
    • createWithReferenceDate

      public Period createWithReferenceDate(long duration, long referenceDate)
      Description copied from interface: PeriodBuilder
      Create a period of the given duration using the provided reference date.
      Specified by:
      createWithReferenceDate in interface PeriodBuilder
      Parameters:
      duration - the duration in milliseconds from the referenced time to the target time. A negative duration indicates a time before the reference time
      referenceDate - the reference date from which to compute the period
      Returns:
      a Period that represents the duration
    • withTimeZone

      public PeriodBuilder withTimeZone(TimeZone timeZone)
      Description copied from interface: PeriodBuilder
      Returns a new PeriodBuilder that computes periods starting at dates in the provided time zone.
      Specified by:
      withTimeZone in interface PeriodBuilder
    • withLocale

      public PeriodBuilder withLocale(String localeName)
      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 interface PeriodBuilder
    • withSettings

      protected abstract PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse)
    • handleCreate

      protected abstract Period handleCreate(long duration, long referenceDate, boolean inPast)