12ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller/* GENERATED SOURCE. DO NOT MODIFY. */ 22ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller/* 32ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller ******************************************************************************* 42ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Copyright (C) 2007-2015, International Business Machines Corporation and 52ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * others. All Rights Reserved. 62ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller ******************************************************************************* 72ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 82ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fullerpackage android.icu.text; 92ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 102ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fullerimport java.text.FieldPosition; 112ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fullerimport java.text.ParsePosition; 122ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fullerimport java.util.Date; 132ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 142ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fullerimport android.icu.impl.duration.BasicDurationFormat; 152ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fullerimport android.icu.util.ULocale; 162ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 172ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller/** 182ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * This <b>deprecated</b> class implements a formatter over a duration in time 192ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * such as "2 days from now" or "3 hours ago". 202ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * 212ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * <p>Use MeasureFormat to format periods like "5 days, 3 hours"; 222ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * use RelativeDateTimeFormatter to format relative dates like "5 days ago". 232ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * 242ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @see MeasureFormat 252ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @see RelativeDateTimeFormatter 262ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @deprecated ICU 56 Use MeasureFormat or RelativeDateTimeFormatter instead. 27836e6b40a94ec3fb7545a76cb072960442b7eee9Neil Fuller * @hide Only a subset of ICU is exposed in Android 282ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 292ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller@Deprecated 302ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fullerpublic abstract class DurationFormat extends UFormat { 312ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 322ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller private static final long serialVersionUID = -2076961954727774282L; 332ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 342ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 352ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Construct a duration format for the specified locale 362ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @deprecated ICU 56 372ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 382ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller @Deprecated 392ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller public static DurationFormat getInstance(ULocale locale) { 402ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller return BasicDurationFormat.getInstance(locale); 412ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller } 422ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 432ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 442ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 452ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Subclass interface 462ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @deprecated This API is ICU internal only. 47836e6b40a94ec3fb7545a76cb072960442b7eee9Neil Fuller * @hide draft / provisional / internal are hidden on Android 482ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 492ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller @Deprecated 502ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller protected DurationFormat() { 512ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller } 522ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 532ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 542ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Subclass interface 552ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @deprecated This API is ICU internal only. 56836e6b40a94ec3fb7545a76cb072960442b7eee9Neil Fuller * @hide draft / provisional / internal are hidden on Android 572ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 582ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller @Deprecated 592ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller protected DurationFormat(ULocale locale) { 602ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller setLocale(locale,locale); 612ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller } 622ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 632ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 642ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Format an arbitrary object. 652ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Defaults to a call to formatDurationFromNow() for either Long or Date objects. 662ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param object the object to format. Should be either a Long, Date, or javax.xml.datatype.Duration object. 672ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param toAppend the buffer to append to 682ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param pos the field position, may contain additional error messages. 692ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @return the toAppend buffer 702ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @deprecated ICU 56 712ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 722ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller @Deprecated 732ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller public abstract StringBuffer format(Object object, StringBuffer toAppend, 742ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller FieldPosition pos); 752ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 762ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 772ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * DurationFormat cannot parse, by default. This method will throw an UnsupportedOperationException. 782ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @deprecated ICU 56 792ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 802ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller @Deprecated 812ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller public Object parseObject(String source, ParsePosition pos) { 822ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller throw new UnsupportedOperationException(); 832ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller } 842ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 852ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 862ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Formats the duration between now and a target date. 872ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * <p> 882ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * This is a convenience method that calls 892ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * formatDurationFrom(long, long) using now 902ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * as the reference date, and the difference between now and 912ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * <code>targetDate.getTime()</code> as the duration. 922ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * 932ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param targetDate the ending date 942ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @return the formatted time 952ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @deprecated ICU 56 962ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 972ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller @Deprecated 982ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller public abstract String formatDurationFromNowTo(Date targetDate); 992ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 1002ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 1012ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Formats a duration expressed in milliseconds. 1022ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * <p> 1032ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * This is a convenience method that calls formatDurationFrom 1042ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * using the current system time as the reference date. 1052ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * 1062ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param duration the duration in milliseconds 1072ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @return the formatted time 1082ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @deprecated ICU 56 1092ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 1102ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller @Deprecated 1112ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller public abstract String formatDurationFromNow(long duration); 1122ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller 1132ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller /** 1142ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * Formats a duration expressed in milliseconds from a reference date. 1152ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * <p> 1162ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * The reference date allows formatters to use actual durations of 1172ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * variable-length periods (like months) if they wish. 1182ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * <p> 1192ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * The duration is expressed as the number of milliseconds in the 1202ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * past (negative values) or future (positive values) with respect 1212ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * to a reference date (expressed as milliseconds in epoch). 1222ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * 1232ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param duration the duration in milliseconds 1242ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @param referenceDate the date from which to compute the duration 1252ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @return the formatted time 1262ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller * @deprecated ICU 56 1272ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller */ 1282ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller @Deprecated 1292ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller public abstract String formatDurationFrom(long duration, long referenceDate); 1302ae130017183d2f66d55bf0ca51f8da3294644fdNeil Fuller} 131