org.crosswire.common.icu
Class DateFormatter

java.lang.Object
  extended by org.crosswire.common.icu.DateFormatter

public class DateFormatter
extends Object

DateFormat provides a wrapper of some of DateFormat and SimpleDateFormat using ICU4J if present, otherwise from core Java. Note, only those methods in DateFormat that are actually used are here.

Author:
DM Smith [dmsmith555 at yahoo dot com]
See Also:
for license details.
The copyright to this program is held by it's authors.

Field Summary
static int DEFAULT
          Constant for default style pattern.
private  Object formatter
          The actual formatter.
private  Class formatterClass
          The class of the formatter
static int FULL
          Constant for full style pattern.
static int LONG
          Constant for long style pattern.
static int MEDIUM
          Constant for medium style pattern.
static int SHORT
          Constant for short style pattern.
 
Constructor Summary
private DateFormatter()
          Prevent instantiation.
 
Method Summary
 String format(Date date)
           
static DateFormatter getDateInstance()
           
static DateFormatter getDateInstance(int format)
           
static DateFormatter getSimpleDateInstance(String format)
           
 Date parse(String text)
           
 void setLenient(boolean lenient)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FULL

public static final int FULL
Constant for full style pattern.

See Also:
Constant Field Values

LONG

public static final int LONG
Constant for long style pattern.

See Also:
Constant Field Values

MEDIUM

public static final int MEDIUM
Constant for medium style pattern.

See Also:
Constant Field Values

SHORT

public static final int SHORT
Constant for short style pattern.

See Also:
Constant Field Values

DEFAULT

public static final int DEFAULT
Constant for default style pattern. Its value is MEDIUM.

See Also:
Constant Field Values

formatter

private Object formatter
The actual formatter.


formatterClass

private Class formatterClass
The class of the formatter

Constructor Detail

DateFormatter

private DateFormatter()
Prevent instantiation.

Method Detail

getDateInstance

public static DateFormatter getDateInstance(int format)

getDateInstance

public static DateFormatter getDateInstance()

getSimpleDateInstance

public static DateFormatter getSimpleDateInstance(String format)

setLenient

public void setLenient(boolean lenient)

format

public String format(Date date)

parse

public Date parse(String text)
           throws ParseException
Throws:
ParseException

Copyright ยจ 2003-2007