Package com.softwaremining.util
Class CBLMath
java.lang.Object
com.softwaremining.util.CBLMath
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimalacos(BigDecimal input) static doubleannuity(double percentage, double numberOfPeriods) return annuity value same as in COBOLstatic BigDecimalasin(BigDecimal input) static BigDecimalatan(BigDecimal input) static BigDecimalcos(BigDecimal input) static doublefactorial(double value) return value of computed factorial for its first argumentstatic BigDecimallog(BigDecimal input) static BigDecimallog10(BigDecimal input) static doublemax(double[] args) returns largest number in the sequencestatic doublemax(AbstractCBLNumeric theField) return maximum from a field.static Stringreturn maximum from a field.static Stringreturn maximum from sequence of strings, where maximum is determined through lexicographical comparisonsstatic doublemean(double[] args) static doublemean(AbstractCBLNumeric theField) return MEAN from an arrayed field.static doublemedian(double[] args) static doublemedian(AbstractCBLNumeric theField) return median from a field.static doublemidrange(double[] args) static doublemidrange(AbstractCBLNumeric theField) return MID-RANGE from a field.static doublemin(double[] args) static doublemin(AbstractCBLNumeric theField) return minimum from a field.static Stringreturn minimum from a field.static Stringreturn minimum from sequence of strings, where minimum is determined through lexicographical comparisonsstatic BigDecimalmin(BigDecimal[] args) static doublemod(double arg1, double arg2) static doublereturn numeric value of its first argumentstatic doublenumval(ISMNumeric field) return numeric value of its first argumentstatic doublereturn numeric value of its argument.static doublenumvalC(ISMNumeric field) return numeric value of its first argumentstatic doublenumvalC(ISMNumeric field, String currencySign) return numeric value of its first argumentstatic doublereturn numeric value of its first argumentstatic doublereturn numeric value of its first argumentstatic doublereturn numeric value of its first argumentstatic doublereturn numeric value of its first argumentstatic intordMax(double[] args) Translation of COBOL INTRINSIC FUNCTION ORD-MAX.static doubleordMax(AbstractCBLNumeric theField) Translation of COBOL INTRINSIC FUNCTION ORD-MAX.static intTranslation of COBOL INTRINSIC FUNCTION ORD-MAX.static intordMin(double[] args) Translation of COBOL INTRINSIC FUNCTION ORD-MIN.static doubleordMin(AbstractCBLNumeric theField) Translation of COBOL INTRINSIC FUNCTION ORD-MIN.static intTranslation of COBOL INTRINSIC FUNCTION ORD-MIN.static doublepresentField(double[] args2) Deprecated.- use persentValuestatic doublepresentField(double arg1, double[] args2) Deprecated.- use persentValuestatic doublepresentField(AbstractCBLNumeric theField) Deprecated.- please use presentValuestatic doublepresentValue(double[] args2) Translation of COBOL INTRINSIC FUNCTION PRESENT-VALUEstatic doublepresentValue(double arg1, double[] args2) Translation of COBOL INTRINSIC FUNCTION PRESENT-VALUEstatic doublepresentValue(AbstractCBLNumeric theField) Translation of COBOL INTRINSIC FUNCTION PRESENT-VALUE It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)static doublerange(double[] args) return RANGE from a field (numerical difference between min and max) It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)static doublerange(AbstractCBLNumeric theField) return RANGE from a field.static final voidsetRound(ISMNumeric theField, double doubleVal) Support for COBOL's ROUNDED statement.static BigDecimalsin(BigDecimal input) static doublestandardDeviation(double arg) interface function for degenerative case of one argumentstatic doublestandardDeviation(double[] args) interface function for degenerative case of one argumentstatic doublestandardDeviation(AbstractCBLNumeric theField) interface function for degenerative case of one argument It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)static BigDecimaltan(BigDecimal input) static inttestNumval(String argument1) IBM's CALL FUNCTION TEST-NUMVAL (ARG)static inttestNumvalC(String argument1) IBM's CALL FUNCTION TEST-NUMVAL-C (ARG)static StringDeprecated.- please use java's string.trim()static doublevariance(double arg) Function for degenerative case of one argumentstatic doublevariance(double[] args) Function for degenerative case of one argumentstatic doublevariance(AbstractCBLNumeric theField) Function for degenerative case of one argument It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)
-
Field Details
-
log
-
-
Constructor Details
-
CBLMath
public CBLMath()
-
-
Method Details
-
max
public static double max(double[] args) returns largest number in the sequence- Parameters:
args-- Returns:
-
max
return maximum from sequence of strings, where maximum is determined through lexicographical comparisons- Parameters:
args-- Returns:
- lexicographical maximum
-
max
return maximum from a field. It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)- Parameters:
theField-- Returns:
-
max
return maximum from a field. It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)- Parameters:
theField-- Returns:
-
min
public static double min(double[] args) -
min
-
min
return minimum from sequence of strings, where minimum is determined through lexicographical comparisons- Parameters:
args-- Returns:
- lexicographical minimum
-
min
return minimum from a field. It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)- Parameters:
theField-- Returns:
-
min
return minimum from a field. It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)- Parameters:
theField-- Returns:
-
mean
public static double mean(double[] args) -
mean
return MEAN from an arrayed field. It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)- Parameters:
theField-- Returns:
-
median
public static double median(double[] args) -
median
return median from a field. It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)- Parameters:
theField-- Returns:
-
midrange
public static double midrange(double[] args) -
midrange
return MID-RANGE from a field. It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)- Parameters:
theField-- Returns:
-
range
public static double range(double[] args) return RANGE from a field (numerical difference between min and max) It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)- Parameters:
theField-- Returns:
-
range
return RANGE from a field. (numerical difference between min and max) It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)- Parameters:
theField-- Returns:
-
mod
public static double mod(double arg1, double arg2) -
ordMax
public static int ordMax(double[] args) Translation of COBOL INTRINSIC FUNCTION ORD-MAX.
returns position of the largest (max) item in the provided list. The position is starts at 1- Returns:
- \
-
ordMax
Translation of COBOL INTRINSIC FUNCTION ORD-MAX. It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)
returns position of the largest (max) item in the provided list. The position is starts at 1- Returns:
- \
-
ordMax
Translation of COBOL INTRINSIC FUNCTION ORD-MAX.
returns position of the largest (max) item in the provided list. The position is starts at 1- Parameters:
args-- Returns:
-
ordMin
public static int ordMin(double[] args) Translation of COBOL INTRINSIC FUNCTION ORD-MIN.
returns position of the smallest (min) item in the provided list. The position is starts at 1- Returns:
-
ordMin
Translation of COBOL INTRINSIC FUNCTION ORD-MIN.
returns position of the smallest (min) item in the provided list. The position is starts at 1 -
ordMin
Translation of COBOL INTRINSIC FUNCTION ORD-MIN. It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)
returns position of the smallest (min) item in the provided list. The position is starts at 1 -
variance
public static double variance(double arg) Function for degenerative case of one argument -
variance
public static double variance(double[] args) Function for degenerative case of one argument -
variance
Function for degenerative case of one argument It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations) -
standardDeviation
public static double standardDeviation(double arg) interface function for degenerative case of one argument -
standardDeviation
public static double standardDeviation(double[] args) interface function for degenerative case of one argument -
standardDeviation
interface function for degenerative case of one argument It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations) -
presentField
public static double presentField(double arg1, double[] args2) Deprecated.- use persentValue- Parameters:
arg1-args2-- Returns:
-
presentValue
public static double presentValue(double arg1, double[] args2) Translation of COBOL INTRINSIC FUNCTION PRESENT-VALUE- Parameters:
arg1-args2-- Returns:
-
presentField
public static double presentField(double[] args2) Deprecated.- use persentValue- Parameters:
arg1-args2-- Returns:
-
presentField
Deprecated.- please use presentValueTranslation of COBOL INTRINSIC FUNCTION PRESENT-VALUE It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)- Parameters:
theField-- Returns:
-
presentValue
Translation of COBOL INTRINSIC FUNCTION PRESENT-VALUE It is expected the field internally represents an arrayed field (it may have multi-dim OCCURS declarations)- Parameters:
theField-- Returns:
-
presentValue
public static double presentValue(double[] args2) Translation of COBOL INTRINSIC FUNCTION PRESENT-VALUE- Parameters:
arg1-args2-- Returns:
-
numval
return numeric value of its argument. NB: currently, CR and DB trailings are not supported- Parameters:
value-- Returns:
- - value of field as a Double
-
testNumvalC
IBM's CALL FUNCTION TEST-NUMVAL-C (ARG)- Parameters:
argument1-- Returns:
-
testNumval
IBM's CALL FUNCTION TEST-NUMVAL (ARG)- Parameters:
argument1-- Returns:
-
numval
return numeric value of its first argument- Parameters:
field-- Returns:
- - value of field as a Double
-
numval
return numeric value of its first argument- Parameters:
field-- Returns:
- - value of field as a Double
-
numvalC
return numeric value of its first argument- Parameters:
value-- Returns:
- - value of field as a Double
-
numvalC
return numeric value of its first argument- Parameters:
value-- Returns:
- - value of field as a Double
-
numvalC
return numeric value of its first argument- Parameters:
field-- Returns:
- - value of field as a Double
-
numvalC
return numeric value of its first argument- Parameters:
value-currencySign-- Returns:
- - value of field as a Double
-
numvalC
return numeric value of its first argument- Parameters:
field-currencySign-- Returns:
- - value of field as a Double
-
numvalC
return numeric value of its first argument- Parameters:
field-currencySign-- Returns:
- - value of field as a Double
-
factorial
public static double factorial(double value) return value of computed factorial for its first argument- Parameters:
value-- Returns:
- - factorial
-
annuity
public static double annuity(double percentage, double numberOfPeriods) return annuity value same as in COBOL- Parameters:
value-- Returns:
- - annuity value for investment amount of 1.0
-
setRound
Support for COBOL's ROUNDED statement. E.g. Subtract A from B ROUNDED- Parameters:
doubleVal-
-
trim
Deprecated.- please use java's string.trim()- Parameters:
s1-- Returns:
-
cos
-
sin
-
acos
-
asin
-
log
-
log10
-
tan
-
atan
-