Class SignedEbcdicNumberInterpreter

java.lang.Object
org.jpos.iso.SignedEbcdicNumberInterpreter
All Implemented Interfaces:
Interpreter

public class SignedEbcdicNumberInterpreter extends Object implements Interpreter
Implements EBCDIC Interpreter for signed numerics. (see http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ad06900_.htm) Strings are converted to and from EBCDIC bytes. Negatives will be prepended with "-" Unsigned numbers are interpreted as positive
  • Field Details

  • Constructor Details

  • Method Details

    • interpret

      public void interpret(String data, byte[] targetArray, int offset)
      Description copied from interface: Interpreter
      Converts the string data into a different interpretation. Standard interpretations are ASCII, EBCDIC, BCD and LITERAL.
      Specified by:
      interpret in interface Interpreter
    • uninterpret

      public String uninterpret(byte[] rawData, int offset, int length)
      Description copied from interface: Interpreter
      Converts the byte array into a String. This reverses the interpret method.
      Specified by:
      uninterpret in interface Interpreter
      Parameters:
      rawData - The interpreted data.
      offset - The index in rawData to start interpreting at.
      length - The number of data units to interpret.
      Returns:
      The uninterpreted data.
    • getPackedLength

      public int getPackedLength(int nDataUnits)
      Description copied from interface: Interpreter
      Returns the number of bytes required to interpret a String of length nDataUnits.
      Specified by:
      getPackedLength in interface Interpreter