Class CBLUtil

java.lang.Object
com.softwaremining.util.CBLUtil

public class CBLUtil extends Object
  • Constructor Details

    • CBLUtil

      public CBLUtil()
  • Method Details

    • isEbcidicNumber

      public static final boolean isEbcidicNumber(ISMObject field)
      check the content of field is a number
      Parameters:
      field -
      Returns:
      - true if number
    • isNumber

      public static final boolean isNumber(double field)
      check the content of field is a number
      Parameters:
      field -
      Returns:
      - true if number
    • isNumber

      public static final boolean isNumber(String value)
      check the content of field is a number
      Parameters:
      field -
      Returns:
      - true if number
    • isNumber

      public static final boolean isNumber(CBLBean wrapper)
      check the content of a record is a number
      Parameters:
      wrapper - : the record (CBLBean)
      Returns:
      - true if number
    • isNumber

      public static final boolean isNumber(ISMObject theField)
      check the content of field is a number
      Parameters:
      field -
      Returns:
      - true if number
    • isAlpha

      public static final boolean isAlpha(ISMObject field)
      check the content of field is a number
      Parameters:
      field -
      Returns:
      - true if number
    • isAlpha

      public static final boolean isAlpha(String text)
      check the content of field is a number
      Parameters:
      field -
      Returns:
      - true if number
    • isAlphaNumeric

      public static final boolean isAlphaNumeric(ISMObject field)
    • dateOfInteger

      public static final int dateOfInteger(long days)
      Replacement for function 'date-of-integer' converts a date in the Gregorian calendar from integer date form to standard date form (YYYYMMDD).
      Parameters:
      days - - positive integer that represents a number of days succeeding December 31, 1600, in the Gregorian calendar. The valid range is 1 to 3,067,671, which corresponds to dates ranging from January 1, 1601 thru December 31, 9999.
      Returns:
      - an integer of the form YYYYMMDD where YYYY represents a year in the Gregorian calendar; MM represents the month of that year; and DD represents the day of that month.
    • dateOfIntegerAsStr

      public static String dateOfIntegerAsStr(long days)
    • integerOfDay

      public static final int integerOfDay(long date)
      SAS 11.03.2009
      Returns:
      returns number of days since December 31, 1600 for the date DATE.
    • dayOfInteger

      public static final int dayOfInteger(long days)
      SAS 10.03.2009 Replacement for function 'day-of-integer' in MicroFocus
    • integerOfDate

      public static final int integerOfDate(long date)
      Replacement for function 'integer-of-date' in MicroFocus The INTEGER-OF-DATE function converts a date in the Gregorian calendar from standard date form (YYYYMMDD) to integer date form.
      Parameters:
      date - - Must be an integer of the form YYYYMMDD, whose value is retrieveed from the calculation (YYYY * 10,000) + (MM * 100) + DD, where: YYYY represents the year in the Gregorian calendar. It must be an integer greater than 1600, but not greater than 9999. MM represents a month and must be a positive integer less than 13. DD represents a day and must be a positive integer less than 32, provided that it is valid for the specified month and year combination.
      date -
      Returns:
      - The returned value is an integer that is the number of days that the date represented by argument-1 succeeds December 31, 1600 in the Gregorian calendar.
    • integerOfDate

      public static final int integerOfDate(String date)
      Replacement for function 'integer-of-date' in MicroFocus The INTEGER-OF-DATE function converts a date in the Gregorian calendar from standard date form (YYYYMMDD) to integer date form.
      Parameters:
      date - - Must be an integer of the form YYYYMMDD, whose value is retrieveed from the calculation (YYYY * 10,000) + (MM * 100) + DD, where: YYYY represents the year in the Gregorian calendar. It must be an integer greater than 1600, but not greater than 9999. MM represents a month and must be a positive integer less than 13. DD represents a day and must be a positive integer less than 32, provided that it is valid for the specified month and year combination.
      Returns:
      - The returned value is an integer that is the number of days that the date represented by argument-1 succeeds December 31, 1600 in the Gregorian calendar.
    • replaceUnderlines

      public static final String replaceUnderlines(String src)
      Used internally by SoftwareMining Framework replace '_' with '-'
    • pad

      public static final String pad(Object toPad, int length)
    • trimToSize

      public static final String trimToSize(String toTrim, char filler, int length, boolean left)
    • capitalize

      public static final String capitalize(String name)
      Parameters:
      name -
      Returns:
    • integerPart

      public static final long integerPart(double value)
      translation of IBM Function IntegerPart ABCD
      Parameters:
      field -
      Returns:
      - true if number
    • integerPart

      public static final long integerPart(long value)
      translation of IBM Function IntegerPart ABCD
      Parameters:
      field -
      Returns:
      - true if number
    • isInRange

      public static final boolean isInRange(ISMObject field, String range)
      check whether field is in range
      Parameters:
      field -
      range -
      Returns:
      - true if range contains field's value as a string
    • isInRange

      public static final boolean isInRange(String stringValue, String range)
    • isInRange

      public static final boolean isInRange(ISMObject field, String from, String to)
      check whether field is in range from FROM to TO
      Parameters:
      field -
      from -
      to -
      Returns:
      - true if field's value is lexicographically between FROM and TO
    • isInRange

      public static final boolean isInRange(String theValue, String from, String to)
      check whether field is in range from FROM to TO
      Parameters:
      from -
      to -
      field -
      Returns:
      - true if field's value is lexicographically between FROM and TO
    • isUppercase

      public static final boolean isUppercase(ISMObject field)
      check whether string is in upper case
      Parameters:
      field -
      Returns:
      - true if range contains field's value as a string
    • isUppercase

      public static final boolean isUppercase(String str)
    • isLowercase

      public static final boolean isLowercase(ISMObject field)
      check whether string is in lower case
      Parameters:
      field -
      Returns:
      - true if range contains field's value as a string
    • isLowercase

      public static final boolean isLowercase(String str)
    • nationalOf

      public static final String nationalOf(String value)
      to do ..
      Translation of NATIONAL-OF Function
      Parameters:
      value -
      Returns:
    • displayOf

      public static final String displayOf(String value, int outputCodePage)
      to do ..
      Translation of DISPLAY-OF Function
      Parameters:
      value -
      Returns:
    • displayOf

      public static final String displayOf(String value)
      to do ..
      Translation of DISPLAY-OF Function
      Parameters:
      value -
      Returns:
    • ord

      public static int ord(String inputStr)
      Translation of COBOL INTRINSIC FUNCTION ORD.
      Parameters:
      inputStr -
      Returns:
    • charValue

      public static String charValue(int ord)
      Translation of COBOL INTRINSIC FUNCTION ORD.
      Parameters:
      inputStr -
      Returns: