Package com.softwaremining.util
Class CBLStringProcessor
java.lang.Object
com.softwaremining.util.CBLStringProcessor
StringProcessor replicates COBOL's STRING statements.
Concatenates the partial or complete contents of two or more strings into one single data item.
Concatenates the partial or complete contents of two or more strings into one single data item.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCncatenationClause
(String toConcatenate, String delimtor) boolean
process()
static boolean
process
(AbstractDataObject resultField, String[] toConcatenate, String[] delimiters) Concatenates the list of "toConcatenate" strings using delimiters, and place the result into resultFieldstatic boolean
process
(AbstractDataObject resultField, String[] toConcatenate, String[] delimeters, ISMNumeric positionPointerField) Concatenates the list of "toConcatenate" strings using delimiters, and place the result into resultFieldstatic boolean
processSubString
(AbstractDataObject resultField, int offset, String[] toConcatenate, String[] delimiters) Concatenates the list of "toConcatenate" strings using delimiters, and place the result into resultFieldvoid
setPointer
(ISMNumeric pointer)
-
Field Details
-
totalRuntime
public static long totalRuntimefor internal use only ... profiling information
-
-
Constructor Details
-
CBLStringProcessor
-
CBLStringProcessor
-
-
Method Details
-
addCncatenationClause
-
setPointer
-
process
public boolean process() -
process
public static boolean process(AbstractDataObject resultField, String[] toConcatenate, String[] delimeters, ISMNumeric positionPointerField) Concatenates the list of "toConcatenate" strings using delimiters, and place the result into resultField- Parameters:
resultField
- - Will contain result of the concatenationtoConcatenate
- - List of strings to concatenatedelimeters
- - must match the number of items in "toConcatenate". e.g. for toConcatenate item "ABC01" , a delimiter of "0" will cause the string to be trimmed to "ABC"positionPointerField
- : the concatenation result will be placed into position in this field. Also, after concatenation, the field will be set to length of concatenated elements- Returns:
- - OVERFLOW: if true - it means the length of concatenations were larger than that provided in the resultField
-
process
public static boolean process(AbstractDataObject resultField, String[] toConcatenate, String[] delimiters) Concatenates the list of "toConcatenate" strings using delimiters, and place the result into resultField- Parameters:
resultField
- - Will contain result of the concatenationtoConcatenate
- - List of strings to concatenatedelimiters
- - must match the number of items in "toConcatenate". e.g. for toConcatenate item "ABC01" , a delimiter of "0" will cause the string to be trimmed to "ABC"- Returns:
- - OVERFLOW: if true - it means the length of concatenations were larger than that provided in the resultField
-
processSubString
public static boolean processSubString(AbstractDataObject resultField, int offset, String[] toConcatenate, String[] delimiters) Concatenates the list of "toConcatenate" strings using delimiters, and place the result into resultField- Parameters:
toConcatenate
- - List of strings to concatenatedelimiters
- - must match the number of items in "toConcatenate". e.g. for toConcatenate item "ABC01" , a delimiter of "0" will cause the string to be trimmed to "ABC"resultBean
- - Will contain result of the concatenationpositionPointerField
- : the concatenation result will be placed into position in this field. Also, after concatenation, the field will be set to length of concatenated elements- Returns:
- - OVERFLOW: if true - it means the length of concatenations were larger than that provided in the resultField
-