Package org.jpos.iso
Class SignedEbcdicNumberInterpreter
- java.lang.Object
-
- org.jpos.iso.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
-
-
Field Summary
Fields Modifier and Type Field Description static SignedEbcdicNumberInterpreter
INSTANCE
An instance of this Interpreter.
-
Constructor Summary
Constructors Constructor Description SignedEbcdicNumberInterpreter()
-
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.
-
-
-
Field Detail
-
INSTANCE
public static final SignedEbcdicNumberInterpreter INSTANCE
An instance of this Interpreter. Only one needed for the whole system
-
-
Constructor Detail
-
SignedEbcdicNumberInterpreter
public SignedEbcdicNumberInterpreter()
-
-
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 interfaceInterpreter
-
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 interfaceInterpreter
- 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 interfaceInterpreter
-
-