Package com.jfcbuilder.types
Class MinimalDateFormat
java.lang.Object
java.text.Format
java.text.DateFormat
com.jfcbuilder.types.MinimalDateFormat
- All Implemented Interfaces:
Serializable
,Cloneable
Specialized
DateFormat
that generates the first letter(s) of the month for the first axis tick in that month
followed by that new month's day number for subsequent ticks. Does not generate time strings.
To determine if a new month is seen when formatting, class instances are stateful in remembering the last date value passed to the format method.
WARNING: No special localization formatting is deliberately done. The first letters of the month obtained for the default locale settings are used. This generally works for the English language but is perhaps not be suitable for other languages.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.text.DateFormat
DateFormat.Field
-
Field Summary
Fields inherited from class java.text.DateFormat
AM_PM_FIELD, 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, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor using the default number of month label characters.MinimalDateFormat
(int monthChars) Constructor for using a specific number of month characters. -
Method Summary
Modifier and TypeMethodDescriptionformat
(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) parse
(String source, ParsePosition pos) Methods inherited from class java.text.DateFormat
clone, 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
Methods inherited from class java.text.Format
format, formatToCharacterIterator, parseObject
-
Constructor Details
-
MinimalDateFormat
public MinimalDateFormat()Constructor using the default number of month label characters. -
MinimalDateFormat
public MinimalDateFormat(int monthChars) Constructor for using a specific number of month characters.- Parameters:
monthChars
- The number of month characters to display starting from the first letter of the month.- Throws:
IllegalArgumentException
- if monthChars is less than one.
-
-
Method Details
-
format
- Specified by:
format
in classDateFormat
-
parse
- Specified by:
parse
in classDateFormat
-