Class SignedEbcdicNumberInterpreter
java.lang.Object
org.jpos.iso.SignedEbcdicNumberInterpreter
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionstatic final SignedEbcdicNumberInterpreterAn instance of this Interpreter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetPackedLength(int nDataUnits) Returns the number of bytes required to interpret a String of length nDataUnits.voidConverts the string data into a different interpretation.uninterpret(byte[] rawData, int offset, int length) Converts the byte array into a String.
-
Field Details
-
INSTANCE
An instance of this Interpreter. Only one needed for the whole system
-
-
Constructor Details
-
SignedEbcdicNumberInterpreter
public SignedEbcdicNumberInterpreter()
-
-
Method Details
-
interpret
Description copied from interface:InterpreterConverts the string data into a different interpretation. Standard interpretations are ASCII, EBCDIC, BCD and LITERAL.- Specified by:
interpretin interfaceInterpreter
-
uninterpret
Description copied from interface:InterpreterConverts the byte array into a String. This reverses the interpret method.- Specified by:
uninterpretin 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
Description copied from interface:InterpreterReturns the number of bytes required to interpret a String of length nDataUnits.- Specified by:
getPackedLengthin interfaceInterpreter
-