i-net Clear Reports

com.inet.report.chart.format
Class DateTimeFormat

java.lang.Object
  extended by java.text.Format
      extended by java.text.DateFormat
          extended by com.inet.report.chart.format.DateTimeFormat
All Implemented Interfaces:
ChartFormat, java.io.Serializable, java.lang.Cloneable

public class DateTimeFormat
extends java.text.DateFormat
implements ChartFormat

This is a date and time format with predefined locale-sensitive styles.
For more information to the system defined date and time styles see http://java.sun.com/docs/books/tutorial/i18n/format/dateFormat.html.

Since:
8.0
See Also:
Serialized Form

Field Summary
static java.lang.String PATTERN_CONSTANT_DATE_D_MMMM_YYYY
          The custom data format
static java.lang.String PATTERN_CONSTANT_DATE_EEEE
          The custom data format for day of week in full form, if one exists
static java.lang.String PATTERN_CONSTANT_DATE_MMMM
          The custom data format for month in full form, if one exists
static java.lang.String PATTERN_CONSTANT_DATE_MMMM_YYYY
          The custom data format for month and years in full form
static java.lang.String PATTERN_CONSTANT_DATE_MMM_YY
          The custom data format for month and years in abbreviated form
static java.lang.String PATTERN_CONSTANT_DATE_YYYY
          The custom data format for years
static java.lang.String PATTERN_CONSTANT_FULL
          System default format for full date and time, see DateFormat.FULL
static java.lang.String PATTERN_CONSTANT_LONG
          System default format for long date and time, see DateFormat.LONG
static java.lang.String PATTERN_CONSTANT_MEDIUM
          System default format for medium date and time, see DateFormat.MEDIUM
static java.lang.String PATTERN_CONSTANT_SHORT
          System default format for short date and time, see DateFormat.SHORT
static java.lang.String PATTERN_CONSTANT_TIME_MM
          The custom time format for minutes in abbreviated form
static java.lang.String PATTERN_CONSTANT_TIME_SS
          The custom time format for seconds in abbreviated form
 
Constructor Summary
DateTimeFormat()
          Creates a new instance of format.
 
Method Summary
 DateTimeFormat clone()
          Overrides Cloneable
 java.lang.StringBuffer format(java.util.Date date, java.lang.StringBuffer toAppendTo, java.text.FieldPosition fieldPosition)
          
 java.lang.String getDatePatternConstant()
          Returns the date format pattern constant, e.g.
 java.lang.String getTimePatternConstant()
          Returns the time format pattern constant, e.g.
 java.util.Date parse(java.lang.String source, java.text.ParsePosition pos)
          
 void readProperties(org.w3c.dom.Element element)
          Reads the XML properties of a chart format.
 void saveProperties(java.lang.StringBuffer buffer, int depth)
          Writes the format properties to output.
 void setDatePatternConstant(java.lang.String patternConstant)
          Sets the date format pattern constant, e.g.
 void setFormatingProperties(com.inet.report.chart.format.FormatingProperties properties)
          Sets the location specific formating properties, e.g. locale, time zone, first day of week.
 void setLocale(java.util.Locale locale)
          Sets the locale of chart.
 void setTimePatternConstant(java.lang.String patternConstant)
          Sets the time format pattern constant, e.g.
 

Field Detail

PATTERN_CONSTANT_FULL

public static final java.lang.String PATTERN_CONSTANT_FULL
System default format for full date and time, see DateFormat.FULL

See Also:
Constant Field Values

PATTERN_CONSTANT_LONG

public static final java.lang.String PATTERN_CONSTANT_LONG
System default format for long date and time, see DateFormat.LONG

See Also:
Constant Field Values

PATTERN_CONSTANT_MEDIUM

public static final java.lang.String PATTERN_CONSTANT_MEDIUM
System default format for medium date and time, see DateFormat.MEDIUM

See Also:
Constant Field Values

PATTERN_CONSTANT_SHORT

public static final java.lang.String PATTERN_CONSTANT_SHORT
System default format for short date and time, see DateFormat.SHORT

See Also:
Constant Field Values

PATTERN_CONSTANT_DATE_D_MMMM_YYYY

public static final java.lang.String PATTERN_CONSTANT_DATE_D_MMMM_YYYY
The custom data format

See Also:
Constant Field Values

PATTERN_CONSTANT_DATE_YYYY

public static final java.lang.String PATTERN_CONSTANT_DATE_YYYY
The custom data format for years

See Also:
Constant Field Values

PATTERN_CONSTANT_DATE_MMMM_YYYY

public static final java.lang.String PATTERN_CONSTANT_DATE_MMMM_YYYY
The custom data format for month and years in full form

See Also:
Constant Field Values

PATTERN_CONSTANT_DATE_MMM_YY

public static final java.lang.String PATTERN_CONSTANT_DATE_MMM_YY
The custom data format for month and years in abbreviated form

See Also:
Constant Field Values

PATTERN_CONSTANT_DATE_MMMM

public static final java.lang.String PATTERN_CONSTANT_DATE_MMMM
The custom data format for month in full form, if one exists

See Also:
Constant Field Values

PATTERN_CONSTANT_DATE_EEEE

public static final java.lang.String PATTERN_CONSTANT_DATE_EEEE
The custom data format for day of week in full form, if one exists

See Also:
Constant Field Values

PATTERN_CONSTANT_TIME_MM

public static final java.lang.String PATTERN_CONSTANT_TIME_MM
The custom time format for minutes in abbreviated form

See Also:
Constant Field Values

PATTERN_CONSTANT_TIME_SS

public static final java.lang.String PATTERN_CONSTANT_TIME_SS
The custom time format for seconds in abbreviated form

See Also:
Constant Field Values
Constructor Detail

DateTimeFormat

public DateTimeFormat()
Creates a new instance of format. Initializes the pattern constants with system default format SHORT.

Since:
8.0
Method Detail

getDatePatternConstant

public java.lang.String getDatePatternConstant()
Returns the date format pattern constant, e.g. PATTERN_CONSTANT_DATE_YYYY.

Returns:
the pattern constant.
Since:
8.0
See Also:
setDatePatternConstant(String)

setDatePatternConstant

public void setDatePatternConstant(java.lang.String patternConstant)
Sets the date format pattern constant, e.g. PATTERN_CONSTANT_DATE_YYYY.

Parameters:
patternConstant - the pattern constant (null permitted)
Since:
8.0
See Also:
getDatePatternConstant(), PATTERN_CONSTANT_FULL, PATTERN_CONSTANT_LONG, PATTERN_CONSTANT_MEDIUM, PATTERN_CONSTANT_SHORT, PATTERN_CONSTANT_DATE_D_MMMM_YYYY, PATTERN_CONSTANT_DATE_EEEE, PATTERN_CONSTANT_DATE_MMM_YY, PATTERN_CONSTANT_DATE_MMMM, PATTERN_CONSTANT_DATE_MMMM_YYYY, PATTERN_CONSTANT_DATE_YYYY

getTimePatternConstant

public java.lang.String getTimePatternConstant()
Returns the time format pattern constant, e.g. PATTERN_CONSTANT_TIME_MM.

Returns:
the pattern constant.
Since:
8.0
See Also:
setTimePatternConstant(String)

setTimePatternConstant

public void setTimePatternConstant(java.lang.String patternConstant)
Sets the time format pattern constant, e.g. PATTERN_CONSTANT_TIME_MM.

Parameters:
patternConstant - the pattern constant (null permitted)
Since:
8.0
See Also:
getDatePatternConstant(), PATTERN_CONSTANT_FULL, PATTERN_CONSTANT_LONG, PATTERN_CONSTANT_MEDIUM, PATTERN_CONSTANT_SHORT, PATTERN_CONSTANT_TIME_MM, PATTERN_CONSTANT_TIME_SS

setLocale

public void setLocale(java.util.Locale locale)
Sets the locale of chart. If this locale was not set, uses the system locale.

Specified by:
setLocale in interface ChartFormat
Parameters:
locale - the locale (null not permitted)

setFormatingProperties

public void setFormatingProperties(com.inet.report.chart.format.FormatingProperties properties)
Sets the location specific formating properties, e.g. locale, time zone, first day of week.

Specified by:
setFormatingProperties in interface ChartFormat
Parameters:
properties - the properties object (null not permitted)

format

public java.lang.StringBuffer format(java.util.Date date,
                                     java.lang.StringBuffer toAppendTo,
                                     java.text.FieldPosition fieldPosition)

Specified by:
format in class java.text.DateFormat

parse

public java.util.Date parse(java.lang.String source,
                            java.text.ParsePosition pos)

Specified by:
parse in class java.text.DateFormat

saveProperties

public void saveProperties(java.lang.StringBuffer buffer,
                           int depth)
Writes the format properties to output.

Specified by:
saveProperties in interface ChartFormat
Parameters:
buffer - the output
depth - the depth of XML indent

readProperties

public void readProperties(org.w3c.dom.Element element)
Reads the XML properties of a chart format.

Specified by:
readProperties in interface ChartFormat
Parameters:
element - DOM element
See Also:
ChartFormat.saveProperties(StringBuffer, int)

clone

public DateTimeFormat clone()
Overrides Cloneable

Specified by:
clone in interface ChartFormat
Overrides:
clone in class java.text.DateFormat
Returns:
the chart format

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH