|
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.ATimeStampFmt
Converts between internal and external format of ATimeStamps. The implementation of java.text.DateFormat is used internally.
The internal string format is a decimally encoded number, followed by a blank, followed by a decimally encoded number. The first number is the number of seconds since 19700101 (like a java.util.Date, without millisecond part). The second number denotes the number of nanoseconds. For example, the internal encoding of the timestamp '2003-02-28 09:53:39.955' is '1046422419 955000000'.
A warning: Do not let the user input timestamps. Although this formatter handles it, it is almost impossible for the user to provide a long, locale dependent input pattern he does not know in advance.
| Field Summary | |
static int |
FULL
|
static int |
LONG
|
static int |
MEDIUM
|
static int |
SHORT
|
| Fields inherited from class at.spardat.enterprise.fmt.IFmt |
DEFAULT, LAST_STYLE, MANDATORY, style_ |
| Constructor Summary | |
ATimeStampFmt(int styleDate,
int styleTime,
java.util.Locale l)
Constructor for ATimeStampFmt. |
|
ATimeStampFmt(java.lang.String pattern,
java.util.Locale l,
int style)
Constructs a ATimeStampFmt using a java.text.SimpleDateFormat pattern. |
|
| Method Summary | |
java.lang.Object |
clone()
Returns a clone of this; |
java.lang.String |
format(java.lang.String internal)
Transforms an internal encoding to an external. |
static ATimeStampFmt |
getInstance(int styleDate,
int styleTime,
java.util.Locale l)
Returns a localized formatter instance parametrized with styles |
static ATimeStampFmt |
getInstance(java.lang.String pattern,
int style,
java.util.Locale l)
Returns a non localized formatter where you have to provide the pattern yourself. |
static ATimeStampFmt |
getInstance(java.lang.String pattern,
java.util.Locale l)
Returns a non localized formatter where you have to provide the pattern yourself. |
boolean |
isLegalExternalChar(char aChar)
Examines whether a given character may be part of an external representation. |
boolean |
isLegalInternal(java.lang.String internal)
Determines if the given string is a legal internal 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. |
boolean |
mayBeAppliedTo(byte type)
Defines if this formatter is able to successfully format a specified type. |
java.lang.String |
parse(java.lang.String external)
Tries to transform an external encoding to an internal. |
| Methods inherited from class at.spardat.enterprise.fmt.IFmt |
checkMandatory, getStyle, isMandatory, setMandatory |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int SHORT
public static final int MEDIUM
public static final int LONG
public static final int FULL
| Constructor Detail |
public ATimeStampFmt(int styleDate,
int styleTime,
java.util.Locale l)
styleDate - one of SHORT, MEDIUM, LONG, FULL or the IFmt-stylesstyleTime - one of SHORT, MEDIUM, LONG, FULL or the IFmt-stylesl - the locale
public ATimeStampFmt(java.lang.String pattern,
java.util.Locale l,
int style)
pattern - a pattern as defined in java.text.SimpleDateFormat.l - Localestyle - may be MANDATORY| Method Detail |
public static ATimeStampFmt getInstance(int styleDate,
int styleTime,
java.util.Locale l)
styleDate - one of SHORT, MEDIUM, LONG, FULL or the IFmt-styles.styleTime - one of SHORT, MEDIUM, LONG, FULL or the IFmt-styles.l - the locale
public static ATimeStampFmt getInstance(java.lang.String pattern,
java.util.Locale l)
pattern - a pattern as defined in java.text.SimpleDateFormat.l - Locale
public static ATimeStampFmt getInstance(java.lang.String pattern,
int style,
java.util.Locale l)
pattern - a pattern as defined in java.text.SimpleDateFormat.style - may be MANDATORYl - Locale
public java.lang.String parse(java.lang.String external)
throws FmtParseException
IFmt
parse in class IFmtexternal - the external encoding
FmtParseExceptionIFmt.parse(String)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 int maxLenOfExternal()
IFmt
maxLenOfExternal in class IFmtIFmt.maxLenOfExternal()public boolean isLegalExternalChar(char aChar)
IFmt
isLegalExternalChar in class IFmtaChar - the character to check
IFmt.isLegalExternalChar(char)public boolean isLegalInternal(java.lang.String internal)
IFmt
isLegalInternal in class IFmtinternal - the internal encoding.
IFmt.isLegalInternal(String)public boolean isOneWay()
IFmt
isOneWay in class IFmtIFmt.isOneWay()public boolean mayBeAppliedTo(byte type)
IFmt
mayBeAppliedTo in class IFmttype - a type constant defined in Types.IFmt.mayBeAppliedTo(byte)public java.lang.Object clone()
IFmt
clone in class IFmtIFmt.clone()
|
IMC Epclient 5.0.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||