de.jaret.util.date
Class JaretDateFormatter

java.lang.Object
  extended by de.jaret.util.date.JaretDateFormatter

public class JaretDateFormatter
extends Object

Delegate for the JaretDate class supplying convenient methods for generating formatted, i8ned output.

Version:
$Id: JaretDateFormatter.java 243 2007-02-11 22:08:49Z olk $
Author:
Peter Kliem

Constructor Summary
JaretDateFormatter()
          Default constructor unsing default locale.
JaretDateFormatter(Locale locale)
          Construcor specifying a locale.
 
Method Summary
 boolean equals(Object obj)
          
 String generateDisplayString(JaretDate date)
          Generate a textual representation of the given JaretDate.
 String generateDisplayStringDate(JaretDate date)
          Generate a textual representation of the given JaretDate.
 String getDayOfWeekString(int dayOfWeek)
          Retrieve a localized name for the day of the week.
 Locale getLocale()
          Retrieve the used locale.
 String getMonthString(int month)
           
 String getShortDayOfWeekString(int dayOfWeek)
           
 String getShortMonthString(int month)
           
 int hashCode()
          
 Date parseTextualDate(String text)
           
static String secondsToDisplayString(int sec)
          Generate an output of the format hh:mm:ss for a given number of seconds.
 void setLocale(Locale locale)
          Set the locale for this JaretDateFormatter.
 String toDisplayStringTime(JaretDate date, boolean seconds)
          Generates a textual representation of the time only.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaretDateFormatter

public JaretDateFormatter(Locale locale)
Construcor specifying a locale.

Parameters:
locale - locale to be used

JaretDateFormatter

public JaretDateFormatter()
Default constructor unsing default locale.

Method Detail

getLocale

public Locale getLocale()
Retrieve the used locale.

Returns:
the locale set for the JaretDateFormatter

setLocale

public void setLocale(Locale locale)
Set the locale for this JaretDateFormatter.

Parameters:
locale - Locale to be used

parseTextualDate

public Date parseTextualDate(String text)

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

generateDisplayString

public String generateDisplayString(JaretDate date)
Generate a textual representation of the given JaretDate.

Parameters:
date - the JaretDate to be formatted
Returns:
JaretDate to format

generateDisplayStringDate

public String generateDisplayStringDate(JaretDate date)
Generate a textual representation of the given JaretDate.

Parameters:
date - the JaretDate to be formatted
Returns:
textual represantation of the date (day)

secondsToDisplayString

public static String secondsToDisplayString(int sec)
Generate an output of the format hh:mm:ss for a given number of seconds.

Parameters:
sec - Seconds
Returns:
textual representation

getDayOfWeekString

public String getDayOfWeekString(int dayOfWeek)
Retrieve a localized name for the day of the week.

Parameters:
dayOfWeek -
Returns:
the localized name of the weekday

getMonthString

public String getMonthString(int month)

getShortDayOfWeekString

public String getShortDayOfWeekString(int dayOfWeek)

getShortMonthString

public String getShortMonthString(int month)

toDisplayStringTime

public String toDisplayStringTime(JaretDate date,
                                  boolean seconds)
Generates a textual representation of the time only.

Parameters:
date - JaretDate to be represenetd
seconds - if true seconds will be included (hh:mm:ss), hh:mm otherwise
Returns:
a Textual represenation of the time


Copyright © 2013. All Rights Reserved.