1/* GENERATED SOURCE. DO NOT MODIFY. */
2/*
3******************************************************************************
4* Copyright (C) 2007, International Business Machines Corporation and   *
5* others. All Rights Reserved.                                               *
6******************************************************************************
7*/
8
9package android.icu.impl.duration;
10
11import java.util.TimeZone;
12
13/**
14 * Constructs a Period given a base time and a duration in milliseconds.
15 * <p>
16 * PeriodBuilder may be used alone or be set on a DurationFormatter
17 * to customize how that formatter constructs a Period for formatting.
18 * <p>
19 * None of the operations on PeriodBuilder change the current builder.
20 * @hide Only a subset of ICU is exposed in Android
21 */
22public interface PeriodBuilder {
23  /**
24   * Create a period of the given duration using the current system
25   * time as the reference time.
26   *
27   * @param duration the duration in milliseconds from the current time
28   * to the target time.  A negative duration indicates a time in the past
29   * @return a Period that represents the duration
30   */
31  Period create(long duration);
32
33  /**
34   * Create a period of the given duration using the provided reference date.
35   *
36   * @param duration the duration in milliseconds from the referenct time
37   * to the target time.  A negative duration indicates a time before the
38   * reference time
39   * @param referenceDate the reference date from which to compute the period
40   * @return a Period that represents the duration
41   */
42  Period createWithReferenceDate(long duration, long referenceDate);
43
44  /**
45   * Returns a new PeriodBuilder that uses the provided locale to
46   * determine what periods are available for use.
47   */
48  PeriodBuilder withLocale(String localeName);
49
50  /**
51   * Returns a new PeriodBuilder that computes periods starting at
52   * dates in the provided time zone.
53   */
54  PeriodBuilder withTimeZone(TimeZone tz);
55}
56