Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.yaftp.utils
Class PackedDecimal  view PackedDecimal download PackedDecimal.java

java.lang.Object
  extended bycom.yaftp.utils.DataStructure
      extended bycom.yaftp.utils.PackedDecimal

public class PackedDecimal
extends DataStructure


Field Summary
private  int _DecSize
           
private  int _IntSize
           
private  int _Logical_Dest_Size
           
private  byte[] _PackedWk
           
private static byte ASCII_HIGH_CHAR_NIBBLE
           
private static byte CBL_SIGN_POS1
           
private static byte CBL_SIGN_POS2
           
private static byte CBL_SIGN_POS3
           
private static byte CBL_SIGN_POS4
           
private static byte DEFAULT_NEGATIVE
           
private static byte DEFAULT_POSITIVE
           
private static int MAX_DECIMAL_STRING_SIZE
           
 
Fields inherited from class com.yaftp.utils.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.yaftp.utils.DataStructure
ContainerExists, CopyFrom, CopyTo, GiveElem, SetElem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_NEGATIVE

private static final byte DEFAULT_NEGATIVE
See Also:
Constant Field Values

DEFAULT_POSITIVE

private static final byte DEFAULT_POSITIVE
See Also:
Constant Field Values

ASCII_HIGH_CHAR_NIBBLE

private static final byte ASCII_HIGH_CHAR_NIBBLE
See Also:
Constant Field Values

MAX_DECIMAL_STRING_SIZE

private static final int MAX_DECIMAL_STRING_SIZE
See Also:
Constant Field Values

CBL_SIGN_POS1

private static final byte CBL_SIGN_POS1
See Also:
Constant Field Values

CBL_SIGN_POS2

private static final byte CBL_SIGN_POS2
See Also:
Constant Field Values

CBL_SIGN_POS3

private static final byte CBL_SIGN_POS3
See Also:
Constant Field Values

CBL_SIGN_POS4

private static final byte CBL_SIGN_POS4
See Also:
Constant Field Values

_PackedWk

private byte[] _PackedWk

_IntSize

private int _IntSize

_DecSize

private int _DecSize

_Logical_Dest_Size

private int _Logical_Dest_Size
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

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


toString

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


main

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