com.ibm.btt.format.impl
Class PackedDateFormat
java.lang.Object
com.ibm.btt.format.AbstractFormatElement
com.ibm.btt.format.FieldFormat
com.ibm.btt.format.impl.PackedDateFormat
- All Implemented Interfaces:
- FormatElement
public class PackedDateFormat
- extends FieldFormat
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PackedDateFormat
public PackedDateFormat()
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
(c) Copyright IBM Corporation 1998, 2008