IBM Bank Transformation Toolkit Javadoc

com.ibm.btt.format.impl
Class PackedFormat

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

public class PackedFormat
extends FieldFormat


Field Summary
 
Fields inherited from class com.ibm.btt.format.AbstractFormatElement
dataName, tagName, TOSTRINGS_MARGIN
 
Constructor Summary
PackedFormat()
           
 
Method Summary
protected  java.util.Map<java.lang.String,java.lang.String> attributes()
          Generic attributes method.
protected  java.lang.String basicFormat(long num)
           
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
 int getDecPlaces()
           
 java.lang.String getType()
           
 boolean isSigned()
           
 long parseToLong(java.lang.String aString)
           
 void setDecPlaces(java.lang.String decPlaces)
           
 void setSigned(java.lang.String signed)
           
 void setType(java.lang.String type)
           
 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
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

PackedFormat

public PackedFormat()
Method Detail

basicFormat

protected java.lang.String basicFormat(long num)
                                throws FormatException
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

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

parseToLong

public long parseToLong(java.lang.String aString)
                 throws UnformatException
Throws:
UnformatException

getDecPlaces

public int getDecPlaces()

setDecPlaces

public void setDecPlaces(java.lang.String decPlaces)

isSigned

public boolean isSigned()

setSigned

public void setSigned(java.lang.String signed)

getType

public java.lang.String getType()

setType

public void setType(java.lang.String type)

attributes

protected java.util.Map<java.lang.String,java.lang.String> attributes()
Description copied from class: AbstractFormatElement
Generic attributes method. This method parse throw the 'get' methods of the class, and finds out all the attributes of the bean. It is a simple implementation. Customers are recommended to override this method.

Overrides:
attributes in class AbstractFormatElement
Returns:

IBM Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2008