Package org.jfree.chart.axis
Class QuarterDateFormat
- java.lang.Object
-
- java.text.Format
-
- java.text.DateFormat
-
- org.jfree.chart.axis.QuarterDateFormat
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class QuarterDateFormat extends java.text.DateFormat implements java.lang.Cloneable, java.io.Serializable
A formatter that formats dates to show the year and quarter (for example, '2004 IV' for the last quarter of 2004.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
GREEK_QUARTERS
Symbols for greek numbered quarters.private boolean
quarterFirst
A flag that controls whether the quarter or the year goes first.private java.lang.String[]
quarters
The strings.static java.lang.String[]
REGULAR_QUARTERS
Symbols for regular quarters.static java.lang.String[]
ROMAN_QUARTERS
Symbols for roman numbered quarters.private static long
serialVersionUID
For serialization.-
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 QuarterDateFormat()
Creates a new instance for the default time zone.QuarterDateFormat(java.util.TimeZone zone)
Creates a new instance for the specified time zone.QuarterDateFormat(java.util.TimeZone zone, java.lang.String[] quarterSymbols)
Creates a new instance for the specified time zone.QuarterDateFormat(java.util.TimeZone zone, java.lang.String[] quarterSymbols, boolean quarterFirst)
Creates a new instance for the specified time zone.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Tests this formatter for equality with an arbitrary object.java.lang.StringBuffer
format(java.util.Date date, java.lang.StringBuffer toAppendTo, java.text.FieldPosition fieldPosition)
Formats the given date.java.util.Date
parse(java.lang.String source, java.text.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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
REGULAR_QUARTERS
public static final java.lang.String[] REGULAR_QUARTERS
Symbols for regular quarters.
-
ROMAN_QUARTERS
public static final java.lang.String[] ROMAN_QUARTERS
Symbols for roman numbered quarters.
-
GREEK_QUARTERS
public static final java.lang.String[] GREEK_QUARTERS
Symbols for greek numbered quarters.
-
quarters
private java.lang.String[] quarters
The strings.
-
quarterFirst
private boolean quarterFirst
A flag that controls whether the quarter or the year goes first.
-
-
Constructor Detail
-
QuarterDateFormat
public QuarterDateFormat()
Creates a new instance for the default time zone.
-
QuarterDateFormat
public QuarterDateFormat(java.util.TimeZone zone)
Creates a new instance for the specified time zone.- Parameters:
zone
- the time zone (null
not permitted).
-
QuarterDateFormat
public QuarterDateFormat(java.util.TimeZone zone, java.lang.String[] quarterSymbols)
Creates a new instance for the specified time zone.- Parameters:
zone
- the time zone (null
not permitted).quarterSymbols
- the quarter symbols.
-
QuarterDateFormat
public QuarterDateFormat(java.util.TimeZone zone, java.lang.String[] quarterSymbols, boolean quarterFirst)
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 Detail
-
format
public java.lang.StringBuffer format(java.util.Date date, java.lang.StringBuffer toAppendTo, java.text.FieldPosition fieldPosition)
Formats the given date.- Specified by:
format
in classjava.text.DateFormat
- Parameters:
date
- the date.toAppendTo
- the string buffer.fieldPosition
- the field position.- Returns:
- The formatted date.
-
parse
public java.util.Date parse(java.lang.String source, java.text.ParsePosition pos)
Parses the given string (not implemented).- Specified by:
parse
in classjava.text.DateFormat
- Parameters:
source
- the date string.pos
- the parse position.- Returns:
null
, as this method has not been implemented.
-
equals
public boolean equals(java.lang.Object obj)
Tests this formatter for equality with an arbitrary object.- Overrides:
equals
in classjava.text.DateFormat
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-
-