com.trackstudio.tools.formatter
Class DateFormatter

java.lang.Object
  extended by com.trackstudio.tools.formatter.DateFormatter
All Implemented Interfaces:
java.io.Serializable

public class DateFormatter
extends java.lang.Object
implements java.io.Serializable

This class provides operations for convertion Timestamp into String and vice-versa, using Locale and Timezone

See Also:
Serialized Form

Constructor Summary
DateFormatter(java.lang.String tz, java.lang.String lc)
           
DateFormatter(java.util.TimeZone tz, java.util.Locale lc)
           
 
Method Summary
static java.util.List<java.util.Locale> getAllowedLocales()
           
static java.util.List<java.util.Locale> getAvailableLocales()
           
 java.util.Calendar getCalendar()
          returns Calendar for the Locale and the Timezone
 java.text.DateFormat getDateFormat()
          returns DateFormat object for this DateFormatter
 java.lang.String getInterval(int interval)
           
 java.lang.String getIntervalSelectTag(int interval)
           
 java.util.Locale getLocale()
          returns Locale
static java.util.Locale getLocaleFromString(java.lang.String lc)
           
 java.lang.String getPattern()
           
 java.lang.String getPattern2()
           
 java.util.TimeZone getTimeZone()
          returns Timezone
static java.util.TimeZone getTimeZoneFromString(java.lang.String tz)
           
static void main(java.lang.String[] args)
           
 java.lang.String parse(java.util.Calendar param)
           
 java.lang.String parse(java.sql.Timestamp param)
          converts Timestamp into String
 java.util.Calendar parseToCalendar(java.lang.String param)
           
static java.util.Locale toLocale(java.lang.String lc)
          Language is always lower case, and country is always upper case.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateFormatter

public DateFormatter(java.util.TimeZone tz,
                     java.util.Locale lc)
              throws GranException
Throws:
GranException

DateFormatter

public DateFormatter(java.lang.String tz,
                     java.lang.String lc)
              throws GranException
Throws:
GranException
Method Detail

getLocale

public java.util.Locale getLocale()
returns Locale


getTimeZone

public java.util.TimeZone getTimeZone()
returns Timezone


getCalendar

public java.util.Calendar getCalendar()
returns Calendar for the Locale and the Timezone


getDateFormat

public java.text.DateFormat getDateFormat()
returns DateFormat object for this DateFormatter


parseToCalendar

public java.util.Calendar parseToCalendar(java.lang.String param)
                                   throws GranException
Throws:
GranException

parse

public java.lang.String parse(java.sql.Timestamp param)
converts Timestamp into String


parse

public java.lang.String parse(java.util.Calendar param)

toLocale

public static java.util.Locale toLocale(java.lang.String lc)
Language is always lower case, and country is always upper case. If the language is missing, the string will begin with an underbar. If both the language and country fields are missing, this function will return the empty string, even if the variant field is filled in (you can't have a locale with just a variant-- the variant must accompany a valid language or country code). Examples: "en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr_MAC"

Parameters:
lc -

getTimeZoneFromString

public static java.util.TimeZone getTimeZoneFromString(java.lang.String tz)

getLocaleFromString

public static java.util.Locale getLocaleFromString(java.lang.String lc)

getPattern

public java.lang.String getPattern()

getPattern2

public java.lang.String getPattern2()

getIntervalSelectTag

public java.lang.String getIntervalSelectTag(int interval)
                                      throws GranException
Throws:
GranException

getInterval

public java.lang.String getInterval(int interval)
                             throws GranException
Throws:
GranException

getAvailableLocales

public static java.util.List<java.util.Locale> getAvailableLocales()

getAllowedLocales

public static java.util.List<java.util.Locale> getAllowedLocales()

main

public static void main(java.lang.String[] args)


Copyright © 2002-2008 TrackStudio, Ltd. All Rights Reserved.