Class CobolUtility

java.lang.Object
com.softwaremining.util.CobolUtility

public class CobolUtility extends Object
Utility class used internally by SoftwareMining framework to duplicate some COBOL String functionality
  • Field Details

    • CHAR_ARRAY_ZER0

      public static final char[] CHAR_ARRAY_ZER0
    • CHAR_ARRAY_ONE

      public static final char[] CHAR_ARRAY_ONE
    • CHAR_ARRAY_SPACE

      public static char[] CHAR_ARRAY_SPACE
    • HIGH_VALUES

      public static final byte HIGH_VALUES
      See Also:
    • LOW_VALUES

      public static final byte LOW_VALUES
      See Also:
    • LOW_VALUE_STRING

      public static String LOW_VALUE_STRING
    • HIGH_VALUE_STRING

      public static String HIGH_VALUE_STRING
    • LOW_VALUE_CHAR

      public static char LOW_VALUE_CHAR
    • HIGH_VALUE_CHAR

      public static char HIGH_VALUE_CHAR
    • CHAR_ARRAY_LOW_VALUE

      public static char[] CHAR_ARRAY_LOW_VALUE
    • CHAR_ARRAY_HIGH_VALUE

      public static char[] CHAR_ARRAY_HIGH_VALUE
    • totalTime_getFilledString

      public static long totalTime_getFilledString
      for internal profiling use -
    • totalTime_getFilledChars

      public static long totalTime_getFilledChars
      for internal profiling use -
    • totalRuntime_CobolUtilityFill

      public static long totalRuntime_CobolUtilityFill
  • Constructor Details

    • CobolUtility

      public CobolUtility()
  • Method Details

    • isLowValues

      public static final boolean isLowValues(String src)
      COBOL Is LowValues
      Parameters:
      src -
      Returns:
    • isHighValues

      public static final boolean isHighValues(String src)
      COPBOL is HighValues
      Parameters:
      src -
      Returns:
    • isSpaces

      public static final boolean isSpaces(String src)
      COBOL is Filled With Space
      Parameters:
      src -
      Returns:
    • isZeros

      public static final boolean isZeros(String src)
      COBOL is Filled With Zeros
      Parameters:
      src -
      Returns:
    • isFilled

      public static final boolean isFilled(String src, char c)
      COBOL is Filled With character c
      Parameters:
      src -
      Returns:
      -
    • getFilledString

      public static final String getFilledString(byte filler, long size)
      create and fill a string
      Parameters:
      filler - - string filler
      size - - size of the resulting string
      Returns:
      - filled String
    • getFilledChars

      public static final char[] getFilledChars(char fillChar, long size)
      create and fill a char Array
      Parameters:
      size - - size of the resulting string
      filler - - string filler
      Returns:
      - filled char array
    • getFilledString

      public static final String getFilledString(String _filler, long size)
      create and fill a string
      Parameters:
      size - - size of the resulting string - NOTE: Although the method allows passing a "long" - java does not allow creation of a char[long], hence the system will internally reduce this to an "int"
      filler - - string filler
      Returns:
      - filled String
    • getFilledString

      public static String getFilledString(char _filler, long size)
      Create and fill a string
      Parameters:
      size - - size of the resulting string - NOTE: Although the method allows passing a "long" - java does not allow creation of a char[long], hence the system will internally reduce this to an "int"
      filler - - Character filler
      Returns:
      - filled String
    • getFilledString

      public static String getFilledString(char[] _filler, long size)
      Parameters:
      _filler -
      size - - size of the resulting string - NOTE: Although the method allows passing a "long" - java does not allow creation of a char[long], hence the system will internally reduce this to an "int"
      Returns:
    • getFilledChars

      public static char[] getFilledChars(char[] _filler, long size)
      create and fill a string
      Parameters:
      _filler -
      size - - size of the resulting string - NOTE: Although the method allows passing a "long" - java does not allow creation of a char[long], hence the system will internally reduce this to an "int"
      Returns:
    • byteToString

      public static final String byteToString(byte filler)
      create a string representation of the Byte
      Parameters:
      filler -
      Returns:
    • getPaddedString

      public static final String getPaddedString(String source, char filler, int size, boolean left)
      Padd a string with Filler
      Parameters:
      source - - String to pad
      filler - - filler for padding
      size - - size of the resulting string - NOTE: Although the method allows passing a "long" - java does not allow creation of a char[long], hence the system will internally reduce this to an "int"
      left - - if true pad left. Otherwise pad right
      Returns:
      - new padded string
    • whenCompiled

      public static final String whenCompiled()
      This is currently a hardcoded version number. The COBOL Version provides the following information. 1-4 Four numeric digits of the year in the Gregorian calendar. 5-6 Two numeric digits of the month of the year, in the range 01 through 12. 7-8 Two numeric digits of the day of the month, in the range 01 through 31. 9-10 Two numeric digits of the hours past midnight, in the range 00 through 23. 11-12 Two numeric digits of the minutes past the hour, in the range 00 through 59. 13-14 Two numeric digits of the seconds past the minute, in the range 00 through 59. 15-16 Two numeric digits of the hundredths of a second past the second, in the range 00 through 99. 17 Either the character '-' or the character '+'. The character '-' is returned if the local time indicated in the previous character positions is behind Greenwich Mean Time. The character '+' is returned if the local time indicated is the same as or ahead of Greenwich Mean Time. 18-19 If character position 17 is '-', two numeric digits are returned in the range 00 through 12 indicating the number of hours that the reported time is behind Greenwich Mean Time. If character position 17 is '+', two numeric digits are returned in the range 00 through 13 indicating the number of hours that the reported time is ahead of Greenwich Mean Time. 20-21 Two numeric digits are returned in the range 00 through 59 indicating the number of additional minutes that the reported time is ahead of or behind Greenwich Mean Time, depending on whether character position 17 is '+' or '-', respectively.
      Returns:
    • setWhenCompiled

      public static final void setWhenCompiled(String version)