public interface PeriodBuilderFactory
| Modifier and Type | Method and Description |
|---|---|
PeriodBuilder |
getFixedUnitBuilder(TimeUnit unit)
Returns a builder that represents durations in terms of the single
given TimeUnit.
|
PeriodBuilder |
getMultiUnitBuilder(int unitCount)
Returns a builder that formats up to the given number of time units,
starting with the largest unit less than or equal to the
duration.
|
PeriodBuilder |
getOneOrTwoUnitBuilder()
Returns a builder that formats the largest one or two time units,
starting with the largest period less than or equal to the duration.
|
PeriodBuilder |
getSingleUnitBuilder()
Returns a builder that represents durations in terms of the
single largest period less than or equal to the duration.
|
PeriodBuilderFactory |
setAllowMilliseconds(boolean allow)
Sets whether milliseconds are allowed.
|
PeriodBuilderFactory |
setAllowZero(boolean allow)
Sets whether units with a value of zero are represented in a
period when 'gaps' appear between time units, e.g.
|
PeriodBuilderFactory |
setAvailableUnitRange(TimeUnit minUnit,
TimeUnit maxUnit)
Sets the time units available for use.
|
PeriodBuilderFactory |
setLocale(String localeName)
Sets the locale for the factory.
|
PeriodBuilderFactory |
setMaxLimit(float maxLimit)
Sets the maximum value for the largest available time unit (as
set in setUnits).
|
PeriodBuilderFactory |
setMinLimit(float minLimit)
Sets the minimum value for the smallest available time unit (as
set in setUnits).
|
PeriodBuilderFactory |
setTimeZone(TimeZone timeZone)
Sets the time zone for the factory.
|
PeriodBuilderFactory |
setUnitIsAvailable(TimeUnit unit,
boolean available)
Sets whether the time unit is available for use.
|
PeriodBuilderFactory |
setWeeksAloneOnly(boolean aloneOnly)
Sets whether weeks are used with other units, or only when
weeks are the only unit.
|
PeriodBuilderFactory setAvailableUnitRange(TimeUnit minUnit, TimeUnit maxUnit)
minUnit - the smallest time unit available for usemaxUnit - the largest time unit available for usePeriodBuilderFactory setUnitIsAvailable(TimeUnit unit, boolean available)
unit - the time unitavailable - true if the unit is available for usePeriodBuilderFactory setMaxLimit(float maxLimit)
PeriodBuilderFactory setMinLimit(float minLimit)
PeriodBuilderFactory setAllowZero(boolean allow)
PeriodBuilderFactory setWeeksAloneOnly(boolean aloneOnly)
PeriodBuilderFactory setAllowMilliseconds(boolean allow)
This is intended to be used to set locale-specific behavior. Typically clients will
not call this API and instead call PeriodBuilderFactory.setLocale(java.lang.String).
allow - whether milliseconds should be allowed.PeriodBuilderFactory setLocale(String localeName)
PeriodBuilderFactory setTimeZone(TimeZone timeZone)
timeZone - the timeZonePeriodBuilder getFixedUnitBuilder(TimeUnit unit)
unit - the single TimeUnit with which to represent timesPeriodBuilder getSingleUnitBuilder()
PeriodBuilder getOneOrTwoUnitBuilder()
PeriodBuilder getMultiUnitBuilder(int unitCount)