|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.bankframe.ei.txnhandler.dataformat.DataFormatUtils
This class is a utility class providing common methods for manipulating numerical data in Cobol and hex formats
| Field Summary | |
static char |
CHAR_MINUS
|
static char |
CHAR_PERIOD
|
static char |
CHAR_PLUS
|
static byte |
INTEGER
|
static byte |
SHORT
|
| Constructor Summary | |
DataFormatUtils()
This method is the default constructor for the DataFormatUtils class. |
|
| Method Summary | |
static java.lang.String |
asciiToString(byte[] ascii)
This method converts an ASCII string to java.lang.String format |
static java.lang.String |
cobolNumberToString(byte[] input,
java.lang.String fieldEncoding,
boolean isSigned,
int decBefore,
int decAfter)
This method converts a Cobol number in the byte array into a text String using the specified encoding. |
static java.lang.String |
comp3ToString(byte[] input,
int numWholeDigits,
int numFractionalDigits)
This method converts an COBOL COMP3 number to java.lang.String format |
static java.lang.String |
compToString(byte[] input)
This method converts an COBOL COMP number to java.lang.String format |
static java.lang.String |
ebcdicToString(byte[] ebcdic)
This method converts an EBCDIC string to java.lang.String format |
static byte[] |
hexStringToBytes(java.lang.String input)
This method converts a hex String representation to byte array |
static boolean |
isSigned(java.lang.String sign)
This method determines if the given string flag indicates a signed number has been specified. |
static boolean |
padRight(java.lang.String fillAlignment)
This method determines if the given string flag indicates right-padding has been specified. |
static java.lang.String |
standardToString(byte[] input,
int numWholeDigits,
int numFractionalDigits)
This method converts a COBOL standard number to java.lang.String format |
static byte[] |
subset(byte[] data,
int startIndex,
int endIndex)
This method gets a subset of the specified byte array |
static byte[] |
toAscii(java.lang.String input)
This method converts an java.lang.String to ascii bytes |
static byte[] |
toCobolNumber(java.lang.String input,
java.lang.String fieldEncoding,
boolean isSigned,
int decBefore,
int decAfter)
This method converts a number into a Cobol number in a byte array using the specified encoding. |
static byte[] |
toComp(java.lang.String input,
boolean signed,
int inputSize)
This method converts a numerical string to a COBOL COMP number |
static byte[] |
toComp3(java.lang.String input,
boolean signed,
int maxWholeDigits,
int maxFractionalDigits)
This method converts a numerical string to COBOL COMP3 |
static byte[] |
toEbcdic(java.lang.String input)
This method converts a string to EBCDIC encoding |
static void |
toHex(byte[] input,
java.lang.StringBuffer buffer)
This method creates a hex representation of the given byte array. |
static void |
toHex(byte input,
java.lang.StringBuffer buffer)
This method creates a hex representation of the given byte |
static void |
toHex(int input,
java.lang.StringBuffer buffer)
This method creates a hex representation of the given integer. |
static java.lang.String |
toHexDump(byte[] input)
This method produces a hex dump of the specified byte array |
static java.lang.String |
toHexString(byte input)
This method creates a hex representation of the given byte |
static java.lang.String |
toHexString(byte[] input)
This method creates a hex representation of the given byte array. |
static java.lang.String |
toHexString(int input)
This method creates a hex representation of the given integer. |
static byte[] |
toStandard(java.lang.String input,
boolean signed,
int maxWholeDigits,
int maxFractionalDigits)
This method converts a numerical string to a COBOL standard |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final byte INTEGER
public static final byte SHORT
public static final char CHAR_MINUS
public static final char CHAR_PLUS
public static final char CHAR_PERIOD
| Constructor Detail |
public DataFormatUtils()
| Method Detail |
public static boolean padRight(java.lang.String fillAlignment)
fillAlignment - is the String to check
public static boolean isSigned(java.lang.String sign)
sign - is the String to check
public static java.lang.String cobolNumberToString(byte[] input,
java.lang.String fieldEncoding,
boolean isSigned,
int decBefore,
int decAfter)
input - is a byte array containing a Cobol number to convertfieldEncoding - is the encoding format of the Cobol number input; STD, COMP3, COMP, XisSigned - indicates if the Cobol number is signeddecBefore - indicates the number of places before the decimal pointdecAfter - indicates the number of places after the decimal point
public static byte[] toCobolNumber(java.lang.String input,
java.lang.String fieldEncoding,
boolean isSigned,
int decBefore,
int decAfter)
input - contains the number to convert into a Cobol number formatfieldEncoding - is the encoding format to use for the Cobol number; STD, COMP3, COMP, XisSigned - indicates if the Cobol number is signeddecBefore - indicates the number of places before the decimal pointdecAfter - indicates the number of places after the decimal point
public static void toHex(byte input,
java.lang.StringBuffer buffer)
input - is the byte to represent in hexbuffer - is a StringBuffer containing the hex representation of the bytepublic static java.lang.String toHexString(byte input)
input - is the byte to represent in hex
public static void toHex(byte[] input,
java.lang.StringBuffer buffer)
input - is the byte array to represent in hexbuffer - is a StringBuffer containing the hex representation of the byte arraypublic static java.lang.String toHexString(byte[] input)
input - is the byte array to represent in hex
public static void toHex(int input,
java.lang.StringBuffer buffer)
input - is the integer to represent in hexbuffer - is a StringBuffer containing the hex representation of the integerpublic static java.lang.String toHexString(int input)
input - is the integer to represent in hex
public static java.lang.String toHexDump(byte[] input)
input - is the byte[] to create a hex dump from
public static byte[] hexStringToBytes(java.lang.String input)
input - is the hex String
public static byte[] toEbcdic(java.lang.String input)
input - is String to convert
public static byte[] toAscii(java.lang.String input)
input - is String to convert
public static java.lang.String asciiToString(byte[] ascii)
ascii - byte array
public static java.lang.String ebcdicToString(byte[] ebcdic)
ebcdic - byte array to convert
public static java.lang.String compToString(byte[] input)
input - is a Cobol number byte array
public static byte[] toComp(java.lang.String input,
boolean signed,
int inputSize)
input - is the numerical stringsigned - indicates if the number is signedinputSize - indicates the size of the Cobol number
public static java.lang.String comp3ToString(byte[] input,
int numWholeDigits,
int numFractionalDigits)
input - is the Cobol byte arraynumWholeDigits - is the number of places before decimal pointnumFractionalDigits - is the number of places after decimal point
public static byte[] toComp3(java.lang.String input,
boolean signed,
int maxWholeDigits,
int maxFractionalDigits)
input - is the numerical stringsigned - indicates if the number is signed
public static java.lang.String standardToString(byte[] input,
int numWholeDigits,
int numFractionalDigits)
input - is the Cobol byte arraynumWholeDigits - is the number of places before decimal pointnumFractionalDigits - is the number of places after decimal point
public static byte[] toStandard(java.lang.String input,
boolean signed,
int maxWholeDigits,
int maxFractionalDigits)
input - is the numerical stringsigned - indicates if the number is signed
public static byte[] subset(byte[] data,
int startIndex,
int endIndex)
data - is the byte array to get a subset ofstartIndex - is the start index of the required subsetendIndex - is the end index of the required subset
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||