Package quadbase.util
Class LocaleDateTimeFormat
java.lang.Object
quadbase.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.util.IFormat.
Please use quadbase.util.IDataPointSet.setLabelFormat(int colIndex, IFormat format) to set the
label format of a data column.
- See Also:
-
Field Summary
FieldsFields inherited from interface quadbase.util.IFormat
LOCALEDATETIME, LOCALENUMERIC, LOGICAL, NUMERIC -
Method Summary
Modifier and TypeMethodDescriptionDefine quadbase.util.IFormat.static 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.util.IFormat.intGet the type of instance.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 DATE -
TIME
public static int TIME -
DATETIME
public static int DATETIME
-
-
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.util.IFormat. Return the type of quadbase.util.IFormat.- Specified by:
getFormatTypein interfaceIFormat- Returns:
- IFormat.LOCALEDATETIME
-
format
Define quadbase.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:
-