Package quadbase.reportdesigner.util
Class LocaleDateTimeFormat
java.lang.Object
quadbase.reportdesigner.util.LocaleDateTimeFormat
- All Implemented Interfaces:
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intDATE formatstatic intDATE and TIME formatstatic intTIME formatFields inherited from interface quadbase.reportdesigner.util.IFormat
BARCODE, IMAGEURL, LOCALEDATETIME, LOCALENUMERIC, LOGICAL, NUMERIC, STRING, TEXTURL -
Method Summary
Modifier and TypeMethodDescriptionstatic LocaleDateTimeFormatcreateFormat(String text) For internal use only.Define quadbase.reportdesigner.util.IFormat.For internal use onlystatic LocaleDateTimeFormatCreate an instance of date format for the default locale and style.static LocaleDateTimeFormatgetDateInstance(int style) Create an instance of date format for the default locale and the specified style.static LocaleDateTimeFormatgetDateInstance(int style, Locale locale) Create an instance of date format for the specified locale and style.static LocaleDateTimeFormatgetDateInstance(Locale locale) Create an instance of date format for the specified locale.intGet the date style.static LocaleDateTimeFormatCreate an instance of timestamp format for the default locale and styles.static LocaleDateTimeFormatgetDateTimeInstance(int dateStyle, int timeStyle) Create an instance of timestamp format for the specified styles.static LocaleDateTimeFormatgetDateTimeInstance(int dateStyle, int timeStyle, Locale locale) Create an instance of timestamp format for the specified styles and locale.static LocaleDateTimeFormatgetDateTimeInstance(Locale locale) Create an instance of timestamp format for the specified locale.intDefine quadbase.reportdesigner.util.IFormat.intGet the type of instance.For internal use only.static LocaleDateTimeFormatCreate an instance of time format for the default locale and style.static LocaleDateTimeFormatgetTimeInstance(int style) Create an instance of time format for the specifed locale.static LocaleDateTimeFormatgetTimeInstance(int style, Locale locale) Create an instance of time format for the specifed locale and style.static LocaleDateTimeFormatgetTimeInstance(Locale locale) Create an instance of time format for the specifed locale.intGet the time style.Gets the time zonevoidSets the format localevoidsetTimeZone(TimeZone zone) Sets the time zone
-
Field Details
-
DATE
public static int DATEDATE format -
TIME
public static int TIMETIME format -
DATETIME
public static int DATETIMEDATE and TIME format
-
-
Method Details
-
setLocale
Sets the format locale- Parameters:
locale- The locale to become this format locale.
-
setTimeZone
Sets the time zone- Parameters:
zone- the given new time zone
-
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:
getFormatTypein interfaceIFormat- Returns:
- IFormat.LOCALEDATETIME
-
format
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. -
getDateInstance
Create an instance of date format for the default locale and style.- Returns:
- The new instance
-
getDateInstance
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:
-
getDateInstance
Create an instance of date format for the specified locale.- Parameters:
locale- The specifed locale- Returns:
- The new instance
-
getDateInstance
Create an instance of date format for the specified locale and style.- Parameters:
style- The specifed stylelocale- The specifed locale- Returns:
- The new instance
- See Also:
-
getDateTimeInstance
Create an instance of timestamp format for the default locale and styles.- Returns:
- The new instance
-
getDateTimeInstance
Create an instance of timestamp format for the specified locale.- Parameters:
locale- The specifed locale- Returns:
- The new instance
-
getDateTimeInstance
Create an instance of timestamp format for the specified styles.- Parameters:
dateStyle- The specifed date styletimeStyle- The specified time style- Returns:
- The new instance
- See Also:
-
getDateTimeInstance
Create an instance of timestamp format for the specified styles and locale.- Parameters:
dateStyle- The specifed date styletimeStyle- The specified time stylelocale- The specifed locale- Returns:
- The new instance
- See Also:
-
getTimeInstance
Create an instance of time format for the default locale and style.- Returns:
- The new instance
-
getTimeInstance
Create an instance of time format for the specifed locale.- Parameters:
style- The specifed style- Returns:
- The new instance
- See Also:
-
getTimeInstance
Create an instance of time format for the specifed locale.- Parameters:
locale- The specifed locale- Returns:
- The new instance
- See Also:
-
getTimeInstance
Create an instance of time format for the specifed locale and style.- Parameters:
style- The specifed stylelocale- The specifed locale- Returns:
- The new instance
- See Also:
-
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:
-
getTimeStyle
public int getTimeStyle()Get the time style.- Returns:
- The time style
- See Also:
-
getDateFormat
For internal use only -
getLocale
-
getTextFormat
For internal use only.- Specified by:
getTextFormatin interfaceIFormat
-
createFormat
For internal use only.- Throws:
Exception
-