Class CBLStringProcessor

java.lang.Object
com.softwaremining.util.CBLStringProcessor

public class CBLStringProcessor extends Object
StringProcessor replicates COBOL's STRING statements.
Concatenates the partial or complete contents of two or more strings into one single data item.
  • Field Details

    • totalRuntime

      public static long totalRuntime
      for internal use only ... profiling information
  • Constructor Details

    • CBLStringProcessor

      public CBLStringProcessor(AbstractDataObject field)
    • CBLStringProcessor

      public CBLStringProcessor(ISMBean wrapper)
  • Method Details

    • addCncatenationClause

      public void addCncatenationClause(String toConcatenate, String delimtor)
    • setPointer

      public void setPointer(ISMNumeric pointer)
    • 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 concatenation
      toConcatenate - - List of strings to concatenate
      delimeters - - 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 concatenation
      toConcatenate - - List of strings to concatenate
      delimiters - - 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 concatenate
      delimiters - - 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 concatenation
      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