Skip to content

Computing Functions

anymaker edited this page Apr 4, 2021 · 3 revisions

Functions Available in ObjCalcEngine

Functions that Return Static Values

Null Return null value
Nil Return null value such as Null. Use it when you can't save "null" in interface
True Return boolean value 'true'
False Return boolean value 'false'
Count Calc count not null values in path
Max Detect max value
Min Detect minimal value
SubList Returning a subarray from an incoming array
TrimTo Removes all values from the array, starting from the beginning and ending with the given value
TrimAfter Removes all values from the array from the given value `lastValue` to the end

Functions Working Into Collection For Each Row

Distinct Return true if this row is encountered for the first time
First Return true is current row is first
Last Return true is current row is last
MaxInRows Detect max value in path by all rows
RowNum Return number of current row in collection. Starting from 0.
RowsCount Return the number of rows in this collection

Auxiliary Functions

Decode Provide switch-case-default functionality
Ifnn Return value, if checked value is not null. Short synonym for function IfNotNull
IfNotNull Return value, if checked value is not null
Length Returns the length of the object, or -1 if not applicable
Nvl Return substitute if value is null

Datetime Functions

AddDays Adds or subtracts the specified number of days
AddHours Adds or subtracts a specified number of hours
AddMinutes Adds or subtracts the specified number of minutes
AddMonths Adds or subtracts a specified number of months
AddSeconds Adds or subtracts a specified number of seconds
AddWeeks Adds or subtracts a specified number of weeks
AddYears Adds or subtracts a specified number of years
DateToStr Convert java.util.Date to string with format
LastDayInMonth Returns the last day of the month
LastDayInYear Returns the last day of the year
SysDate Returns the current date without time, that is, the time will always be 00:00:00
SysTime Returns the current datetime
ToDate Converts a string with format to java.util.Date
ToTimeZone Converts a date to a different time zone

String Functions

CharAt Return one character from position. The first position has index 0
EndsWith Tests if string ends with the specified suffix.
ExtractDigits Retrieves all digits from a string
Format Formats a number into a string by mask
IndexOf Returns the index within string of the first occurrence of the specified substring.
IsBlank Checks if string contain only whitespace characters or null
IsEmpty Checks that the string contains no characters or null.
Like Returns true if the condition specified in the template is met, similar to the 'like' operation as in databases
LikeRegexp Return true if the condition specified by the regular expression is true
LTrim Remove leading whitespace
NormalizeSpaces Returned string with normalized spaces
PadLeft Adds characters to the left of the string until the string reaches the specified length.
PadRight Adds characters to the right of the string until the string reaches the specified length.
RemoveSpaces Remove all space characters
RemoveWhitespaces Remove all whitespaces characters
Replace Returns a string resulting from replacing all occurrences of oldString in this string with newString.
RTrim Remove trailing whitespace
StartsWith Tests if string starts with the specified prefix.
Substring Returns a string that is a substring of this string.
ToString Convert any value to String
Trim Returns a string whose value is this string, without leading and trailing whitespace characters
TrimToNull Returns a string without leading and trailing whitespace characters or null if string is empty