com.ibm.dse.base
Class PackedDateFormat
java.lang.Object
|
+--com.ibm.dse.base.FormatElement
|
+--com.ibm.dse.base.FieldFormat
|
+--com.ibm.dse.base.PackedFormat
|
+--com.ibm.dse.base.PackedDateFormat
- public class PackedDateFormat
- extends PackedFormat
This class formats a Date as a String representing the packed value of the Date.
The String represents the Date as a Number of the type ddMMyy.
- See Also:
- Serialized Form
Constructor Summary |
PackedDateFormat()
This is the default constructor used to create a PackedDateFormat object. |
PackedDateFormat(java.lang.String aName)
This is the constructor used by the externalizer to create a PackedDateFormat object. |
Method Summary |
java.lang.String |
format(java.util.Date date)
Converts a Date to a number with digits ddMMyy and
formats it as a packed Integer. |
java.lang.String |
formatField(DataField aDataField)
Accesses the value of the aDataField, checks it, and returns it as an unsigned packed String. |
java.lang.Object |
initializeFrom(Tag aTag)
Initializes a PackedFormat with the aTag attributes.. |
java.util.Date |
parse(java.lang.String aString)
Unformats the packed Integer as a Date. |
java.lang.String |
toString()
Returns a visual representation of the format. |
DataField |
unformatField(java.lang.String aString,
DataField aDataField)
Updates the value of the DataField by interpreting aString as an unsigned packed decimal
representing a Date with form ddMMyy. |
Methods inherited from class com.ibm.dse.base.PackedFormat |
basicFormat,
basicParse,
format,
format,
getDecimalPlaces,
getSigned,
isSigned,
parseToDouble,
parseToLong,
setDecimalPlaces,
setSigned |
Methods inherited from class com.ibm.dse.base.FormatElement |
exceptionInfo,
externalizer,
extract,
format,
getDataElementName,
getExternalizer,
getName,
getTagName,
isCacheable,
isConstant,
readExternal,
readExternal,
readObject,
reinitialize,
removeExternal,
rootDecorated,
setDataElementName,
setExternalizer,
setName,
setSize,
toStrings,
toTags,
unformat,
writeExternal,
writeExternal |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
PackedDateFormat
public PackedDateFormat()
- This is the default constructor used to create a PackedDateFormat object.
PackedDateFormat
public PackedDateFormat(java.lang.String aName)
throws java.io.IOException
- This is the constructor used by the externalizer to create a PackedDateFormat object.
- Parameters:
aString
- java.lang.String
format
public java.lang.String format(java.util.Date date)
throws DSEInvalidArgumentException
- Converts a Date to a number with digits ddMMyy and
formats it as a packed Integer.
- Parameters:
aDate
- java.util.Date- Returns:
- java.lang.String
formatField
public java.lang.String formatField(DataField aDataField)
throws DSEInvalidClassException,
DSEInvalidArgumentException
- Accesses the value of the aDataField, checks it, and returns it as an unsigned packed String.
- Overrides:
- formatField in class PackedFormat
- Parameters:
aDataField
- DataField- Returns:
- String
initializeFrom
public java.lang.Object initializeFrom(Tag aTag)
throws java.io.IOException
- Initializes a PackedFormat with the aTag attributes..
- Overrides:
- initializeFrom in class PackedFormat
- Parameters:
aTag
- com.ibm.dse.base.Tag- Returns:
- java.lang.Object
parse
public java.util.Date parse(java.lang.String aString)
throws DSEInvalidArgumentException
- Unformats the packed Integer as a Date. The digits in the integer should correspond to the ddMMyy format of the Date.
- Parameters:
aString
- java.lang.String- Returns:
- java.util.Date
toString
public java.lang.String toString()
- Returns a visual representation of the format.
- Overrides:
- toString in class PackedFormat
- Returns:
- java.lang.String
unformatField
public DataField unformatField(java.lang.String aString,
DataField aDataField)
throws DSEInvalidArgumentException
- Updates the value of the DataField by interpreting aString as an unsigned packed decimal
representing a Date with form ddMMyy.
- Overrides:
- unformatField in class PackedFormat
- Parameters:
aString
- StringaDataField
- DataField- Returns:
- DataField