IBM Bank Transformation Toolkit Javadoc

com.ibm.btt.format.impl
Class PackedDateFormat

java.lang.Object
  extended by com.ibm.btt.format.AbstractFormatElement
      extended by com.ibm.btt.format.FieldFormat
          extended by com.ibm.btt.format.impl.PackedDateFormat
All Implemented Interfaces:
FormatElement

public class PackedDateFormat
extends FieldFormat


Field Summary
 
Fields inherited from class com.ibm.btt.format.AbstractFormatElement
dataName, tagName, TOSTRINGS_MARGIN
 
Constructor Summary
PackedDateFormat()
           
 
Method Summary
protected  java.lang.String basicFormat(long num)
          Performs the conversion of num into a String.
protected  long basicParse(java.lang.String aString)
          Interprets the String as a packed integer in which a digit is represented by four bits of a character.
 Message format(ReadAdapter dataAdapter)
          This method is attended to be called by client code of FormatElement
 java.util.Date parse(java.lang.String aString)
          Unformats the packed Integer as a Date.
 void unformat(Message message, WriteAdapter dataAdapter)
          This method is attended to be called by client code of FormatElement
 
Methods inherited from class com.ibm.btt.format.FieldFormat
isContainer
 
Methods inherited from class com.ibm.btt.format.AbstractFormatElement
attributes, extract, getDataName, rootDecorated, setDataName, toString, toStrings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.btt.format.FormatElement
extract, getDataName, rootDecorated, toStrings
 

Constructor Detail

PackedDateFormat

public PackedDateFormat()
Method Detail

basicFormat

protected java.lang.String basicFormat(long num)
                                throws FormatException
Performs the conversion of num into a String. In the String each character represents two digits compressed into four bits each. This format takes the asumption that the second byte of a char is 0 (that is, ASCII code).

Parameters:
num - long
Returns:
java.lang.String
Throws:
FormatException

format

public Message format(ReadAdapter dataAdapter)
               throws FormatException
Description copied from interface: FormatElement
This method is attended to be called by client code of FormatElement

Returns:
Throws:
FormatException

parse

public java.util.Date parse(java.lang.String aString)
                     throws UnformatException
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:
UnformatException

basicParse

protected long basicParse(java.lang.String aString)
                   throws UnformatException
Interprets the String as a packed integer in which a digit is represented by four bits of a character. As a result, in the String, each character represents two digits. This format takes the asumption that the second byte of a char is 0 (that is, ASCII code).

Parameters:
aString - java.lang.String
Returns:
long
Throws:
UnformatException

unformat

public void unformat(Message message,
                     WriteAdapter dataAdapter)
              throws UnformatException
Description copied from interface: FormatElement
This method is attended to be called by client code of FormatElement

Throws:
UnformatException

IBM Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2008