Home | History | Annotate | Download | only in duration
      1 /* GENERATED SOURCE. DO NOT MODIFY. */
      2 //  2016 and later: Unicode, Inc. and others.
      3 // License & terms of use: http://www.unicode.org/copyright.html#License
      4 /*
      5 ******************************************************************************
      6 * Copyright (C) 2007, International Business Machines Corporation and   *
      7 * others. All Rights Reserved.                                               *
      8 ******************************************************************************
      9 */
     10 
     11 package android.icu.impl.duration;
     12 
     13 import java.util.Date;
     14 import java.util.TimeZone;
     15 
     16 /**
     17  * Abstract formatter for dates.  Differs from DateFormat in that it
     18  * provides <code>withLocale</code> and <code>withTimeZone</code> methods.
     19  * @hide Only a subset of ICU is exposed in Android
     20  */
     21 public interface DateFormatter {
     22 
     23   /**
     24    * Format the date, provided as a java Date object.
     25    *
     26    * @param date the date
     27    * @return the formatted time
     28    */
     29   String format(Date date);
     30 
     31   /**
     32    * Format the date, provided as milliseconds.
     33    *
     34    * @param date the date in milliseconds
     35    * @return the formatted time
     36    */
     37   String format(long date);
     38 
     39   /**
     40    * Returns a new DateFormatter that uses data for a new locale.
     41    *
     42    * @param locale the new locale to use
     43    * @return a new formatter for the given locale
     44    */
     45   DateFormatter withLocale(String localeName);
     46 
     47   /**
     48    * Returns a new DateFormatter that uses the new time zone.
     49    *
     50    * @param tz the new time zone
     51    * @return a new formatter for the given time zone
     52    */
     53   DateFormatter withTimeZone(TimeZone tz);
     54 }
     55