12ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller/* GENERATED SOURCE. DO NOT MODIFY. */ 2f86f25d102340da66b9c7cb6b2d5ecdc0de43ecfFredrik Roubert// © 2016 and later: Unicode, Inc. and others. 3f86f25d102340da66b9c7cb6b2d5ecdc0de43ecfFredrik Roubert// License & terms of use: http://www.unicode.org/copyright.html#License 42ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller/* 52ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller****************************************************************************** 62ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller* Copyright (C) 2007-2009, International Business Machines Corporation and * 72ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller* others. All Rights Reserved. * 82ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller****************************************************************************** 92ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller*/ 102ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 112ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fullerpackage android.icu.impl.duration; 122ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 132ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fullerimport java.util.TimeZone; 142ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 152ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller/** 16836e6b40a94ec3fb7545a76cb072960442b7eee9Neil Fuller * @hide Only a subset of ICU is exposed in Android 172ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 182ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fullerpublic interface PeriodBuilderFactory { 192ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 202ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 212ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Sets the time units available for use. Default is all units. 222ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param minUnit the smallest time unit available for use 232ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param maxUnit the largest time unit available for use 242ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @return this factory 252ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 262ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller PeriodBuilderFactory setAvailableUnitRange(TimeUnit minUnit, 272ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller TimeUnit maxUnit); 282ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 292ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 302ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Sets whether the time unit is available for use. 312ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param unit the time unit 322ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param available true if the unit is available for use 332ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @return this factory 342ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 352ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller PeriodBuilderFactory setUnitIsAvailable(TimeUnit unit, boolean available); 362ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 372ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 382ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Sets the maximum value for the largest available time unit (as 392ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * set in setUnits). Periods that represent a longer duration than 402ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * this will be pinned to this value of that time unit and return 412ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * true for 'isMoreThan'. Default is no limit. Setting a value of 422ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * zero restores the default. 432ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 442ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller PeriodBuilderFactory setMaxLimit(float maxLimit); 452ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 462ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 472ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Sets the minimum value for the smallest available time unit (as 482ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * set in setUnits). Periods that represent a shorter duration than 492ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * this will be pinned to this value of that time unit and return 502ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * true for 'isLessThan'. Default is no limit. Setting a value of 512ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * zero restores the default. 522ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 532ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller PeriodBuilderFactory setMinLimit(float minLimit); 542ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 552ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 562ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Sets whether units with a value of zero are represented in a 572ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * period when 'gaps' appear between time units, e.g. 582ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * '2 hours, 0 minutes, and 33 seconds'. Default is to 592ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * not represent these explicitly ('2 hours and 33 seconds'). 602ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 612ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller PeriodBuilderFactory setAllowZero(boolean allow); 622ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 632ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 642ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Sets whether weeks are used with other units, or only when 652ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * weeks are the only unit. For example '3 weeks and 2 days' 662ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * versus '23 days'. Default is to use them alone only. 672ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 682ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller PeriodBuilderFactory setWeeksAloneOnly(boolean aloneOnly); 692ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 702ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 712ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Sets whether milliseconds are allowed. This is only examined 722ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * when milliseconds are an available field. The default is to allow 732ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * milliseconds to display normally. 742ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * <p> 752ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * This is intended to be used to set locale-specific behavior. Typically clients will 762ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * not call this API and instead call {@link #setLocale}. 772ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * 782ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param allow whether milliseconds should be allowed. 792ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @return a builder 802ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 812ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller PeriodBuilderFactory setAllowMilliseconds(boolean allow); 822ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 832ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 842ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Sets the locale for the factory. Setting the locale can adjust 852ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * the values for some or all of the other properties to reflect 862ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * language or cultural conventions. Default is to use 872ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * the default locale. 882ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 892ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller PeriodBuilderFactory setLocale(String localeName); 902ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 912ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 922ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Sets the time zone for the factory. This can affect the timezone 932ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * used for date computations. 942ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param timeZone the timeZone 952ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @return a builder 962ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 972ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller PeriodBuilderFactory setTimeZone(TimeZone timeZone); 982ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 992ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Returns a builder that represents durations in terms of the single 1002ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * given TimeUnit. If the factory settings don't make the given unit 1012ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * available, this will return null. 1022ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * 1032ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param unit the single TimeUnit with which to represent times 1042ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @return a builder 1052ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 1062ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller PeriodBuilder getFixedUnitBuilder(TimeUnit unit); 1072ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 1082ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 1092ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Returns a builder that represents durations in terms of the 1102ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * single largest period less than or equal to the duration. 1112ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * 1122ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @return a builder 1132ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 1142ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller PeriodBuilder getSingleUnitBuilder(); 1152ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 1162ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 1172ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Returns a builder that formats the largest one or two time units, 1182ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * starting with the largest period less than or equal to the duration. 1192ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * It formats two periods if the first period has a count < 2 1202ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * and the next period has a count >= 1. 1212ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * 1222ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @return a builder 1232ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 1242ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller PeriodBuilder getOneOrTwoUnitBuilder(); 1252ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 1262ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 1272ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Returns a builder that formats up to the given number of time units, 1282ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * starting with the largest unit less than or equal to the 1292ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * duration. 1302ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * 1312ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @return a builder 1322ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 1332ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller PeriodBuilder getMultiUnitBuilder(int unitCount); 1342ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller} 1352ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 136