Sun Adapter for CICS API

com.stc.eways.cics
Class PackedDecimal

java.lang.Object
  extended by com.stc.eways.cics.DataStructure
      extended by com.stc.eways.cics.PackedDecimal

public class PackedDecimal
extends DataStructure


Field Summary
 
Fields inherited from class com.stc.eways.cics.DataStructure
_Offset, _Size, _Struct, ISO_LATIN_1
 
Constructor Summary
PackedDecimal(byte[] Packed_Origin, int Offset, int IntSize, int DecSize)
          Construct using an existing byte array(Supose to point on a valid packed decimal format or to be translated later with toPackedDecimal method
 
Method Summary
static int getPackedSize(int intSize, int decSize)
          giving int Size + dec size returns physical size necessary to store the packed decimal data
static void main(java.lang.String[] Argv)
          Just use the main method for Class unit testing
 void toPackedDecimal(java.lang.String Number)
          Build a packed decimal from a string number Convert the in String +-99999.99 in an packed decimal IBM data Flow -> Each digit is a 0..9 Numerical value last digit is the sign digit : A|C|E|F => + ; B|D => - ; the decimal point is virtual its position is defined in the second byte of dec_len
 java.lang.String toString()
          Translate current Packed into a String representation
 
Methods inherited from class com.stc.eways.cics.DataStructure
ContainerExists, CopyFrom, CopyTo, GiveElem, SetElem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PackedDecimal

public PackedDecimal(byte[] Packed_Origin,
                     int Offset,
                     int IntSize,
                     int DecSize)
Construct using an existing byte array(Supose to point on a valid packed decimal format or to be translated later with toPackedDecimal method

Parameters:
Packed_Origin - byte array containing COBOL packed decimal data
Offset - offset of packed decimal data in array
IntSize - non decimal part size
DecSize - decimal part size
Method Detail

getPackedSize

public static int getPackedSize(int intSize,
                                int decSize)
giving int Size + dec size returns physical size necessary to store the packed decimal data


toPackedDecimal

public void toPackedDecimal(java.lang.String Number)
                     throws java.lang.NumberFormatException
Build a packed decimal from a string number Convert the in String +-99999.99 in an packed decimal IBM data Flow -> Each digit is a 0..9 Numerical value last digit is the sign digit : A|C|E|F => + ; B|D => - ; the decimal point is virtual its position is defined in the second byte of dec_len

Parameters:
Number - decimal String representation to be converted
Throws:
java.lang.NumberFormatException

toString

public java.lang.String toString()
Translate current Packed into a String representation

Overrides:
toString in class java.lang.Object
Returns:
String representation of packed decimal

main

public static void main(java.lang.String[] Argv)
Just use the main method for Class unit testing


Sun Adapter for CICS API