IBM Branch Transformation Toolkit Javadoc

com.ibm.dse.base
Class PackedDateFormat

java.lang.Object
  extended bycom.ibm.dse.base.FormatElement
      extended bycom.ibm.dse.base.FieldFormat
          extended bycom.ibm.dse.base.PackedFormat
              extended bycom.ibm.dse.base.PackedDateFormat
All Implemented Interfaces:
Cacheable, Externalizable, java.io.Externalizable, java.io.Serializable

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

Field Summary
 
Fields inherited from class com.ibm.dse.base.FormatElement
dataElementName, externalizer, name
 
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.FieldFormat
format, format, toStrings, unformat, unformat
 
Methods inherited from class com.ibm.dse.base.FormatElement
exceptionInfo, externalizer, extract, format, getDataElementName, getExternalizer, getName, getTagName, isCacheable, isConstant, isItConstant, readExternal, readExternal, readObject, reinitialize, removeExternal, rootDecorated, setDataElementName, setExternalizer, setName, setSize, toTags, unformat, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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.

Method Detail

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.

Returns:
java.lang.String
Throws:
DSEInvalidArgumentException

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
Throws:
DSEInvalidClassException
DSEInvalidArgumentException

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException
Initializes a PackedFormat with the aTag attributes.

Specified by:
initializeFrom in interface Externalizable
Overrides:
initializeFrom in class PackedFormat
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object
Throws:
java.io.IOException

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
Throws:
DSEInvalidArgumentException

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 - String
aDataField - DataField
Returns:
DataField
Throws:
DSEInvalidArgumentException

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005