|
IMC Epclient 5.0.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.enterprise.fmt.IFmt
at.spardat.enterprise.fmt.ADateFmt
at.spardat.enterprise.fmt.ADateFmtMediumSmart
This class is a high speed implementation for parsing and formatting dates, like the MEDIUM format of DateFormat. A very restricted set of patterns is allowed. A pattern is a sequence of the following:
d1 ... represents a day component without leading zero d2 ... represents a two digits day component m1 ... represents a month component witout leading zero m2 ... represents a two digits month component y2 ... represents a two digit year component y4 ... represents a four digit year componentOther characters must be used to delimit the components, as long as they do not start with d, m or y. A typical pattern for the austrian local may be "d2.m2.y4". The pattern must consist of exactly one d, one m and one y component. The components must be separated by delimiters. Therefore, a pattern "d2m2y4" is illegal.
| Field Summary | |
protected int |
twoDigitYearOffset_
|
| Fields inherited from class at.spardat.enterprise.fmt.ADateFmt |
FULL, LONG, MEDIUM, SHORT |
| Fields inherited from class at.spardat.enterprise.fmt.IFmt |
DEFAULT, LAST_STYLE, MANDATORY, style_ |
| Constructor Summary | |
protected |
ADateFmtMediumSmart(java.lang.String pattern,
int style)
Constructs using a pattern as defined in the class header. |
| Method Summary | |
java.lang.String |
format(java.lang.String internal)
Transforms an internal encoding to an external. |
java.lang.String |
getPattern()
Returns the pattern set. |
boolean |
isLegalExternalChar(char aChar)
Examines whether a given character may be part of an external representation. |
boolean |
isOneWay()
An IFmt is one way, if the external encoding may be generated out of the internal, but not vice versa. |
int |
maxLenOfExternal()
Returns the maximum length an external string representation may have. |
java.lang.String |
parse(java.lang.String external)
The parse method accepts the following inputs: '0' ... zero stands for today '[-+] number' ... a signed number stands for today plus/minus the provided number of days. |
void |
setPattern(java.lang.String pattern)
Sets the pattern as defined in the class header. |
| Methods inherited from class at.spardat.enterprise.fmt.ADateFmt |
checkDateRange, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getMax, getMaxDate, getMin, getMinDate, isLegalInternal, mayBeAppliedTo, setMax, setMaxDate, setMin, setMinDate |
| Methods inherited from class at.spardat.enterprise.fmt.IFmt |
checkMandatory, clone, getStyle, isMandatory, setMandatory |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int twoDigitYearOffset_
| Constructor Detail |
protected ADateFmtMediumSmart(java.lang.String pattern,
int style)
pattern - the pattern usedstyle - may be MANDATORY
java.lang.RuntimeException - on wrong patterns.| Method Detail |
public void setPattern(java.lang.String pattern)
pattern - the pattern to set
java.lang.RuntimeException - on wrong patternspublic java.lang.String getPattern()
public java.lang.String format(java.lang.String internal)
IFmt
format in class IFmtinternal - the provided internal encoding. This String must satisfy the
condition isLegalInternal(), otherwise the behaviour of this
method is undefined.
IFmt.format(String)public boolean isLegalExternalChar(char aChar)
IFmt
isLegalExternalChar in class IFmtaChar - the character to check
IFmt.isLegalExternalChar(char)public boolean isOneWay()
IFmt
isOneWay in class IFmtIFmt.isOneWay()public int maxLenOfExternal()
IFmt
maxLenOfExternal in class IFmtIFmt.maxLenOfExternal()
public java.lang.String parse(java.lang.String external)
throws AParseException
Some rules apply to parsing the year component. If this componenent consists of at least 3 digits, it is taken as year itself, i.e., 002 means the year 0002. If the year component consists of 2 or 1 digit(s), it is thought of a year without century and a century using a sliding window approach is set down. The century is fixed in a way that the resulting year lies in the interval (currentYear+twoDigitYearOffset_, currentYear+twoDigitYearOffset_+100]
parse in class IFmtexternal - the external encoding
AParseException - if the external encoding cannot be successfully parsed.IFmt.parse(String)
|
IMC Epclient 5.0.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||