Package org.jpos.iso

Class SignedEbcdicNumberInterpreter

  • All Implemented Interfaces:
    Interpreter

    public class SignedEbcdicNumberInterpreter
    extends java.lang.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getPackedLength​(int nDataUnits)
      Returns the number of bytes required to interpret a String of length nDataUnits.
      void interpret​(java.lang.String data, byte[] targetArray, int offset)
      Converts the string data into a different interpretation.
      java.lang.String uninterpret​(byte[] rawData, int offset, int length)
      Converts the byte array into a String.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • interpret

        public void interpret​(java.lang.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 java.lang.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.