Package com.softwaremining.util
Class CBLMath
java.lang.Object
com.softwaremining.util.CBLMath
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimal
acos
(BigDecimal input) static double
annuity
(double percentage, double numberOfPeriods) return annuity value same as in COBOLstatic BigDecimal
asin
(BigDecimal input) static BigDecimal
atan
(BigDecimal input) static BigDecimal
cos
(BigDecimal input) static double
factorial
(double value) return value of computed factorial for its first argumentstatic BigDecimal
log
(BigDecimal input) static BigDecimal
log10
(BigDecimal input) static double
max
(double[] args) returns largest number in the sequencestatic double
max
(AbstractCBLNumeric theField) return maximum from a field.static String
return maximum from a field.static String
return maximum from sequence of strings, where maximum is determined through lexicographical comparisonsstatic double
mean
(double[] args) static double
mean
(AbstractCBLNumeric theField) return MEAN from an arrayed field.static double
median
(double[] args) static double
median
(AbstractCBLNumeric theField) return median from a field.static double
midrange
(double[] args) static double
midrange
(AbstractCBLNumeric theField) return MID-RANGE from a field.static double
min
(double[] args) static double
min
(AbstractCBLNumeric theField) return minimum from a field.static String
return minimum from a field.static String
return minimum from sequence of strings, where minimum is determined through lexicographical comparisonsstatic BigDecimal
min
(BigDecimal[] args) static double
mod
(double arg1, double arg2) static double
return numeric value of its first argumentstatic double
numval
(ISMNumeric field) return numeric value of its first argumentstatic double
return numeric value of its argument.static double
numvalC
(ISMNumeric field) return numeric value of its first argumentstatic double
numvalC
(ISMNumeric field, String currencySign) return numeric value of its first argumentstatic double
return numeric value of its first argumentstatic double
return numeric value of its first argumentstatic double
return numeric value of its first argumentstatic double
return numeric value of its first argumentstatic int
ordMax
(double[] args) Translation of COBOL INTRINSIC FUNCTION ORD-MAX.static double
ordMax
(AbstractCBLNumeric theField) Translation of COBOL INTRINSIC FUNCTION ORD-MAX.static int
Translation of COBOL INTRINSIC FUNCTION ORD-MAX.static int
ordMin
(double[] args) Translation of COBOL INTRINSIC FUNCTION ORD-MIN.static double
ordMin
(AbstractCBLNumeric theField) Translation of COBOL INTRINSIC FUNCTION ORD-MIN.static int
Translation of COBOL INTRINSIC FUNCTION ORD-MIN.static double
presentField
(double[] args2) Deprecated.- use persentValuestatic double
presentField
(double arg1, double[] args2) Deprecated.- use persentValuestatic double
presentField
(AbstractCBLNumeric theField) Deprecated.- please use presentValuestatic double
presentValue
(double[] args2) Translation of COBOL INTRINSIC FUNCTION PRESENT-VALUEstatic double
presentValue
(double arg1, double[] args2) Translation of COBOL INTRINSIC FUNCTION PRESENT-VALUEstatic double
presentValue
(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 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)static double
range
(AbstractCBLNumeric theField) return RANGE from a field.static final void
setRound
(ISMNumeric theField, double doubleVal) Support for COBOL's ROUNDED statement.static BigDecimal
sin
(BigDecimal input) static double
standardDeviation
(double arg) interface function for degenerative case of one argumentstatic double
standardDeviation
(double[] args) interface function for degenerative case of one argumentstatic double
standardDeviation
(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 BigDecimal
tan
(BigDecimal input) static int
testNumval
(String argument1) IBM's CALL FUNCTION TEST-NUMVAL (ARG)static int
testNumvalC
(String argument1) IBM's CALL FUNCTION TEST-NUMVAL-C (ARG)static String
Deprecated.- please use java's string.trim()static double
variance
(double arg) Function for degenerative case of one argumentstatic double
variance
(double[] args) Function for degenerative case of one argumentstatic double
variance
(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:
args2
-arg1
-- 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:
args2
-arg1
-- 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
-