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