Package com.softwaremining.util
Class CobolUtility
java.lang.Object
com.softwaremining.util.CobolUtility
Utility class used internally by SoftwareMining framework to duplicate some
COBOL String functionality
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final String
byteToString
(byte filler) create a string representation of the Bytestatic char[]
getFilledChars
(char[] _filler, long size) create and fill a stringstatic final char[]
getFilledChars
(char fillChar, long size) create and fill a char Arraystatic final String
getFilledString
(byte filler, long size) create and fill a stringstatic String
getFilledString
(char[] _filler, long size) static String
getFilledString
(char _filler, long size) Create and fill a stringstatic final String
getFilledString
(String _filler, long size) create and fill a stringstatic final String
getPaddedString
(String source, char filler, int size, boolean left) Padd a string with Fillerstatic final boolean
COBOL is Filled With character cstatic final boolean
isHighValues
(String src) COPBOL is HighValuesstatic final boolean
isLowValues
(String src) COBOL Is LowValuesstatic final boolean
COBOL is Filled With Spacestatic final boolean
COBOL is Filled With Zerosstatic final void
setWhenCompiled
(String version) static final String
This is currently a hardcoded version number.
-
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
-
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_getFilledStringfor internal profiling use - -
totalTime_getFilledChars
public static long totalTime_getFilledCharsfor internal profiling use - -
totalRuntime_CobolUtilityFill
public static long totalRuntime_CobolUtilityFill
-
-
Constructor Details
-
CobolUtility
public CobolUtility()
-
-
Method Details
-
isLowValues
COBOL Is LowValues- Parameters:
src
-- Returns:
-
isHighValues
COPBOL is HighValues- Parameters:
src
-- Returns:
-
isSpaces
COBOL is Filled With Space- Parameters:
src
-- Returns:
-
isZeros
COBOL is Filled With Zeros- Parameters:
src
-- Returns:
-
isFilled
COBOL is Filled With character c- Parameters:
src
-- Returns:
- -
-
getFilledString
create and fill a string- Parameters:
filler
- - string fillersize
- - 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 stringfiller
- - string filler- Returns:
- - filled char array
-
getFilledString
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
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
- 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
create a string representation of the Byte- Parameters:
filler
-- Returns:
-
getPaddedString
Padd a string with Filler- Parameters:
source
- - String to padfiller
- - filler for paddingsize
- - 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
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
-