Class MonthSymbol
java.lang.Object
com.aquima.interactions.foundation.text.symbol.NumberSymbol
com.aquima.interactions.foundation.text.symbol.MonthSymbol
- All Implemented Interfaces:
IDateSymbol
,Serializable
NumberSymbol class to represent the Calendar.MONTH field in a date string.
- Since:
- 5.1
- Author:
- C. de Meijer
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
format
(Calendar c, StringBuffer sb) Formats this symbol's field of the specified Calendar, and appends it to the StringBuffer.int
Returns the Calendar field this NumberSymbol represents.Return the pattern representation of this NumberSymbol.int
getWidth()
Returns the width of the symbol.int
Parses part of the dateString parameter.toString()
Methods inherited from class com.aquima.interactions.foundation.text.symbol.NumberSymbol
lz, parseDatePartAsInteger
-
Constructor Details
-
MonthSymbol
public MonthSymbol()
-
-
Method Details
-
format
Description copied from interface:IDateSymbol
Formats this symbol's field of the specified Calendar, and appends it to the StringBuffer.- Parameters:
c
- Calendar object which holds the date/time that needs to be formatted. The instance is created inside the format method of the DateFormat class.sb
- StringBuffer in which to place the result of the formatting operation.
-
getCalendarField
public int getCalendarField()Description copied from class:NumberSymbol
Returns the Calendar field this NumberSymbol represents.- Specified by:
getCalendarField
in classNumberSymbol
- Returns:
- int Denoting the Calendar field this NumberSymbol represents.
-
getWidth
public int getWidth()Description copied from interface:IDateSymbol
Returns the width of the symbol. When parsing a date string without separators, this width is used to calculate the expected total string length. When parsing a date string with separators, this width is used to limit the maximum amount of characters to consider. The result of this method is used during formatting to determine the number of leading zeroes required.- Returns:
- int The width of this symbol.
-
parse
Description copied from interface:IDateSymbol
Parses part of the dateString parameter. This method may return a negative integer to indicate failure.- Parameters:
dateString
- String value containing the date/time representation to be parsed.pos
- Integer value indicating the position at which to start parsing.maxWidth
- Integer value indicating the maximum number of characters to consume.- Returns:
- Non-negative integer containing the value parsed.
- Negative integer indicating a parse error. (Will be handled by DateFormat by throwing a ParseException indicating the position of the error).
-
getPattern
Description copied from interface:IDateSymbol
Return the pattern representation of this NumberSymbol.- Returns:
- String representing the pattern.
-
toString
-