Package org.jfree.chart.axis
Class QuarterDateFormat
java.lang.Object
java.text.Format
java.text.DateFormat
org.jfree.chart.axis.QuarterDateFormat
- All Implemented Interfaces:
Serializable
,Cloneable
A formatter that formats dates to show the year and quarter (for example,
'2004 IV' for the last quarter of 2004.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.text.DateFormat
DateFormat.Field
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String[]
Symbols for greek numbered quarters.static final String[]
Symbols for regular quarters.static final String[]
Symbols for roman numbered quarters.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
ConstructorDescriptionCreates a new instance for the default time zone.QuarterDateFormat
(TimeZone zone) Creates a new instance for the specified time zone.QuarterDateFormat
(TimeZone zone, String[] quarterSymbols) Creates a new instance for the specified time zone.QuarterDateFormat
(TimeZone zone, String[] quarterSymbols, boolean quarterFirst) Creates a new instance for the specified time zone. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests this formatter for equality with an arbitrary object.format
(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) Formats the given date.parse
(String source, ParsePosition pos) Parses the given string (not implemented).Methods inherited from class java.text.DateFormat
clone, format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, hashCode, isLenient, parse, parseObject, setCalendar, setLenient, setNumberFormat, setTimeZone
Methods inherited from class java.text.Format
format, formatToCharacterIterator, parseObject
-
Field Details
-
REGULAR_QUARTERS
Symbols for regular quarters. -
ROMAN_QUARTERS
Symbols for roman numbered quarters. -
GREEK_QUARTERS
Symbols for greek numbered quarters.
-
-
Constructor Details
-
QuarterDateFormat
public QuarterDateFormat()Creates a new instance for the default time zone. -
QuarterDateFormat
Creates a new instance for the specified time zone.- Parameters:
zone
- the time zone (null
not permitted).
-
QuarterDateFormat
Creates a new instance for the specified time zone.- Parameters:
zone
- the time zone (null
not permitted).quarterSymbols
- the quarter symbols.
-
QuarterDateFormat
Creates a new instance for the specified time zone.- Parameters:
zone
- the time zone (null
not permitted).quarterSymbols
- the quarter symbols.quarterFirst
- a flag that controls whether the quarter or the year is displayed first.
-
-
Method Details
-
format
Formats the given date.- Specified by:
format
in classDateFormat
- Parameters:
date
- the date.toAppendTo
- the string buffer.fieldPosition
- the field position.- Returns:
- The formatted date.
-
parse
Parses the given string (not implemented).- Specified by:
parse
in classDateFormat
- Parameters:
source
- the date string.pos
- the parse position.- Returns:
null
, as this method has not been implemented.
-
equals
Tests this formatter for equality with an arbitrary object.- Overrides:
equals
in classDateFormat
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-