]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-52_1/main/classes/core/src/com/ibm/icu/impl/duration/DateFormatter.java
Added flags.
[Dictionary.git] / jars / icu4j-52_1 / main / classes / core / src / com / ibm / icu / impl / duration / DateFormatter.java
1 /*
2 ******************************************************************************
3 * Copyright (C) 2007, International Business Machines Corporation and   *
4 * others. All Rights Reserved.                                               *
5 ******************************************************************************
6 */
7
8 package com.ibm.icu.impl.duration;
9
10 import java.util.Date;
11 import java.util.TimeZone;
12
13 /**
14  * Abstract formatter for dates.  Differs from DateFormat in that it
15  * provides <code>withLocale</code> and <code>withTimeZone</code> methods.
16  */
17 public interface DateFormatter {
18
19   /**
20    * Format the date, provided as a java Date object.
21    * 
22    * @param date the date
23    * @return the formatted time
24    */
25   String format(Date date);
26
27   /**
28    * Format the date, provided as milliseconds.
29    *
30    * @param date the date in milliseconds
31    * @return the formatted time
32    */
33   String format(long date);
34
35   /**
36    * Returns a new DateFormatter that uses data for a new locale.
37    *
38    * @param locale the new locale to use
39    * @return a new formatter for the given locale
40    */
41   DateFormatter withLocale(String localeName);
42
43   /**
44    * Returns a new DateFormatter that uses the new time zone.
45    *
46    * @param tz the new time zone
47    * @return a new formatter for the given time zone
48    */
49   DateFormatter withTimeZone(TimeZone tz);
50 }