Package com.inet.report.chart.format
Class DateTimeFormat
- java.lang.Object
-
- java.text.Format
-
- java.text.DateFormat
-
- 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://docs.oracle.com/javase/8/docs/api/java/text/DateFormat.html.- Since:
- 8.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PATTERN_CONSTANT_DATE_D_MMMM_YYYY
The custom data formatstatic java.lang.String
PATTERN_CONSTANT_DATE_EEEE
The custom data format for day of week in full form, if one existsstatic java.lang.String
PATTERN_CONSTANT_DATE_MMM_YY
The custom data format for month and years in abbreviated formstatic java.lang.String
PATTERN_CONSTANT_DATE_MMMM
The custom data format for month in full form, if one existsstatic java.lang.String
PATTERN_CONSTANT_DATE_MMMM_YYYY
The custom data format for month and years in full formstatic java.lang.String
PATTERN_CONSTANT_DATE_YYYY
The custom data format for yearsstatic java.lang.String
PATTERN_CONSTANT_FULL
System default format for full date and time, seeDateFormat.FULL
static java.lang.String
PATTERN_CONSTANT_LONG
System default format for long date and time, seeDateFormat.LONG
static java.lang.String
PATTERN_CONSTANT_MEDIUM
System default format for medium date and time, seeDateFormat.MEDIUM
static java.lang.String
PATTERN_CONSTANT_SHORT
System default format for short date and time, seeDateFormat.SHORT
static java.lang.String
PATTERN_CONSTANT_TIME_MM
The custom time format for minutes in abbreviated formstatic java.lang.String
PATTERN_CONSTANT_TIME_SS
The custom time format for seconds in abbreviated form-
Fields inherited from class java.text.DateFormat
AM_PM_FIELD, calendar, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, ERA_FIELD, FULL, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR0_FIELD, HOUR1_FIELD, LONG, MEDIUM, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, numberFormat, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD
-
-
Constructor Summary
Constructors Constructor Description DateTimeFormat()
Creates a new instance of format.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DateTimeFormat
clone()
Overrides Cloneablejava.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.protected java.lang.String
getName()
FOR INTERNAL USE ONLY Returns the XML attribute name for this dataset.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.StringBuilder 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
setTimePatternConstant(java.lang.String patternConstant)
Sets the time format pattern constant, e.g.-
Methods inherited from class java.text.DateFormat
equals, format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, hashCode, isLenient, parse, parseObject, setCalendar, setLenient, setNumberFormat, setTimeZone
-
-
-
-
Field Detail
-
PATTERN_CONSTANT_FULL
public static final java.lang.String PATTERN_CONSTANT_FULL
System default format for full date and time, seeDateFormat.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, seeDateFormat.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, seeDateFormat.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, seeDateFormat.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
-
-
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
-
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 interfaceChartFormat
- 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 classjava.text.DateFormat
-
parse
public java.util.Date parse(java.lang.String source, java.text.ParsePosition pos)
- Specified by:
parse
in classjava.text.DateFormat
-
saveProperties
public void saveProperties(java.lang.StringBuilder buffer, int depth)
Writes the format properties to output.- Specified by:
saveProperties
in interfaceChartFormat
- Parameters:
buffer
- the outputdepth
- 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 interfaceChartFormat
- Parameters:
element
- DOM element- See Also:
ChartFormat.saveProperties(StringBuilder, int)
-
getName
protected java.lang.String getName()
FOR INTERNAL USE ONLY Returns the XML attribute name for this dataset.- Returns:
- the name.
-
clone
public DateTimeFormat clone()
Overrides Cloneable- Specified by:
clone
in interfaceChartFormat
- Overrides:
clone
in classjava.text.DateFormat
- Returns:
- the chart format
-
-