EspressReport 6.6

quadbase.reportdesigner.util
Class LocaleDateTimeFormat

java.lang.Object
  extended by quadbase.reportdesigner.util.LocaleDateTimeFormat
All Implemented Interfaces:
IFormat

public class LocaleDateTimeFormat
extends java.lang.Object
implements IFormat

This class formats and parses date and/or time values in a locale-specific way. It cannot directly extand java.text.DateFormat because java.text.DateFormat is an abstract class. All formats implement quadbase.reportdesigner.util.IFormat. Please use quadbase.reportdesigner.util.IDataPointSet.setLabelFormat(int colIndex, IFormat format) to set the label format of a data column.

See Also:
DateTimeFormat, NumericFormat, LocaleNumericFormat, LogicalFormat, IFormat

Field Summary
static int DATE
          DATE format
static int DATETIME
          DATE and TIME format
static int TIME
          TIME format
 
Fields inherited from interface quadbase.reportdesigner.util.IFormat
BARCODE, IMAGEURL, LOCALEDATETIME, LOCALENUMERIC, LOGICAL, NUMERIC, STRING, TEXTURL
 
Method Summary
static LocaleDateTimeFormat createFormat(java.lang.String text)
          For internal use only.
 java.lang.String format(java.lang.Object obj)
          Define quadbase.reportdesigner.util.IFormat.
 java.text.DateFormat getDateFormat()
          For internal use only
static LocaleDateTimeFormat getDateInstance()
          Create an instance of date format for the default locale and style.
static LocaleDateTimeFormat getDateInstance(int style)
          Create an instance of date format for the default locale and the specified style.
static LocaleDateTimeFormat getDateInstance(int style, java.util.Locale locale)
          Create an instance of date format for the specified locale and style.
static LocaleDateTimeFormat getDateInstance(java.util.Locale locale)
          Create an instance of date format for the specified locale.
 int getDateStyle()
          Get the date style.
static LocaleDateTimeFormat getDateTimeInstance()
          Create an instance of timestamp format for the default locale and styles.
static LocaleDateTimeFormat getDateTimeInstance(int dateStyle, int timeStyle)
          Create an instance of timestamp format for the specified styles.
static LocaleDateTimeFormat getDateTimeInstance(int dateStyle, int timeStyle, java.util.Locale locale)
          Create an instance of timestamp format for the specified styles and locale.
static LocaleDateTimeFormat getDateTimeInstance(java.util.Locale locale)
          Create an instance of timestamp format for the specified locale.
 int getFormatType()
          Define quadbase.reportdesigner.util.IFormat.
 int getInstanceType()
          Get the type of instance.
 java.util.Locale getLocale()
           
 java.lang.String getTextFormat()
          For internal use only.
static LocaleDateTimeFormat getTimeInstance()
          Create an instance of time format for the default locale and style.
static LocaleDateTimeFormat getTimeInstance(int style)
          Create an instance of time format for the specifed locale.
static LocaleDateTimeFormat getTimeInstance(int style, java.util.Locale locale)
          Create an instance of time format for the specifed locale and style.
static LocaleDateTimeFormat getTimeInstance(java.util.Locale locale)
          Create an instance of time format for the specifed locale.
 int getTimeStyle()
          Get the time style.
 java.util.TimeZone getTimeZone()
          Gets the time zone
 void setLocale(java.util.Locale locale)
          Sets the format locale
 void setTimeZone(java.util.TimeZone zone)
          Sets the time zone
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE

public static int DATE
DATE format


TIME

public static int TIME
TIME format


DATETIME

public static int DATETIME
DATE and TIME format

Method Detail

setLocale

public void setLocale(java.util.Locale locale)
Sets the format locale

Parameters:
locale - The locale to become this format locale.

setTimeZone

public void setTimeZone(java.util.TimeZone zone)
Sets the time zone

Parameters:
zone - the given new time zone

getTimeZone

public java.util.TimeZone getTimeZone()
Gets the time zone

Returns:
the time zone associated with this format

getFormatType

public int getFormatType()
Define quadbase.reportdesigner.util.IFormat. Return the type of quadbase.reportdesigner.util.IFormat.

Specified by:
getFormatType in interface IFormat
Returns:
IFormat.LOCALEDATETIME

format

public java.lang.String format(java.lang.Object obj)
Define quadbase.reportdesigner.util.IFormat. Format the object if it is an instance of java.sql.Date, java.sql.Time, java.sql.Timestamp. Otherwise, call the default toString() method. Argurment type java.util.Date is not supported here.

Specified by:
format in interface IFormat
Parameters:
obj - The target object
Returns:
Formatted string

getDateInstance

public static LocaleDateTimeFormat getDateInstance()
Create an instance of date format for the default locale and style.

Returns:
The new instance

getDateInstance

public static LocaleDateTimeFormat getDateInstance(int style)
Create an instance of date format for the default locale and the specified style.

Parameters:
style - The specifed style
Returns:
The new instance
See Also:
for all available styles

getDateInstance

public static LocaleDateTimeFormat getDateInstance(java.util.Locale locale)
Create an instance of date format for the specified locale.

Parameters:
locale - The specifed locale
Returns:
The new instance

getDateInstance

public static LocaleDateTimeFormat getDateInstance(int style,
                                                   java.util.Locale locale)
Create an instance of date format for the specified locale and style.

Parameters:
style - The specifed style
locale - The specifed locale
Returns:
The new instance
See Also:
for all available styles

getDateTimeInstance

public static LocaleDateTimeFormat getDateTimeInstance()
Create an instance of timestamp format for the default locale and styles.

Returns:
The new instance

getDateTimeInstance

public static LocaleDateTimeFormat getDateTimeInstance(java.util.Locale locale)
Create an instance of timestamp format for the specified locale.

Parameters:
locale - The specifed locale
Returns:
The new instance

getDateTimeInstance

public static LocaleDateTimeFormat getDateTimeInstance(int dateStyle,
                                                       int timeStyle)
Create an instance of timestamp format for the specified styles.

Parameters:
dateStyle - The specifed date style
timeStyle - The specified time style
Returns:
The new instance
See Also:
for all available styles

getDateTimeInstance

public static LocaleDateTimeFormat getDateTimeInstance(int dateStyle,
                                                       int timeStyle,
                                                       java.util.Locale locale)
Create an instance of timestamp format for the specified styles and locale.

Parameters:
dateStyle - The specifed date style
timeStyle - The specified time style
locale - The specifed locale
Returns:
The new instance
See Also:
for all available styles

getTimeInstance

public static LocaleDateTimeFormat getTimeInstance()
Create an instance of time format for the default locale and style.

Returns:
The new instance

getTimeInstance

public static LocaleDateTimeFormat getTimeInstance(int style)
Create an instance of time format for the specifed locale.

Parameters:
style - The specifed style
Returns:
The new instance
See Also:
for all available styles

getTimeInstance

public static LocaleDateTimeFormat getTimeInstance(java.util.Locale locale)
Create an instance of time format for the specifed locale.

Parameters:
locale - The specifed locale
Returns:
The new instance
See Also:
for all available styles

getTimeInstance

public static LocaleDateTimeFormat getTimeInstance(int style,
                                                   java.util.Locale locale)
Create an instance of time format for the specifed locale and style.

Parameters:
style - The specifed style
locale - The specifed locale
Returns:
The new instance
See Also:
for all available styles

getInstanceType

public int getInstanceType()
Get the type of instance.

Returns:
DATE, TIME or DATETIME

getDateStyle

public int getDateStyle()
Get the date style.

Returns:
The date style
See Also:
for all available styles

getTimeStyle

public int getTimeStyle()
Get the time style.

Returns:
The time style
See Also:
for all available styles

getDateFormat

public java.text.DateFormat getDateFormat()
For internal use only


getLocale

public java.util.Locale getLocale()

getTextFormat

public java.lang.String getTextFormat()
For internal use only.

Specified by:
getTextFormat in interface IFormat

createFormat

public static LocaleDateTimeFormat createFormat(java.lang.String text)
                                         throws java.lang.Exception
For internal use only.

Throws:
java.lang.Exception

EspressReport 6.6