Java report tool finereport common functions usage Summary (Array Function), javafinereport
ADD2ARRAY
ADDARRAY (array, insertArray, start): inserts all elements in insertArray at the start position of the array and returns the array.
Example:
ADDARRAY ([3, 4, 1, 5, 7], [23, 43, 22], 3) Returns [3, 4, 23, 43, 22, 1, 5, 7].
ADDARRAY ([3, 4, 1, 5, 7], "test", 3) Returns [3, 4, "test", 1, 5, 7].
Note:
If start is less than 1 or the start parameter is not specified, array elements are inserted from the first part of the array by default.
ARRAY
ARRAY (arg1, arg2. ..): returns an ARRAY composed of arg1, arg2.
Arg1, arg2,...: string or number.
Example:
ARRAY ("hello") = ["hello"].
ARRAY ("hello", "world") = ["hello", "world"].
ARRAY ("hello", 98) = ["hello", 98].
ARRAY (67,98) = [67,98].
GETARRAYELEMENT
GETARRAYELEMENT (array, index): The function returns the index element of the array.
Example:
String [] array = {"a", "B", "c", "d "}
GETARRAYELEMENT (array, 3) equals to c.
GETARRAYELEMENT (array, 1) is equal to.
GREPARRAY
GREPARRAY (array, fn): The function (return true or false) is a condition. filter this array and form a new array.
Example:
GREPARRAY ([3, 4, 2, 3, 6, 8, 7], "item! = 3 ") equal to [, 7]
Note: The second parameter of this function is a string.
INARRAY
INARRAY (co, array): return the position of co in the array. If co is not in the array, 0 is returned.
Example:
String [] arr = {"a", "B", "c", "d "}
Then INARRAY ("B", arr) is equal to 2.
INDEX
INDEX (key, val1, val2,...): returns the position of the key in the sequence composed of val1, val2,.... If it does not exist in the sequence, it returns the number of parameters.
Note:
Key and valn can be of any type
Example:
INDEX (2, 2) is equal to 1.
INDEX (2, 1, 2) is equal to 2.
INDEX (2, 4, 5, 6) is 4.
INDEX ("B", "B", "o", "y") is equal to 1.
INDEXOFARRAY
INDEXOFARRAY (array, index): returns the index element of the array.
Example:
INDEXOFARRAY (["first", "second", "third"], 2) returns "second ".
MAPARRAY
MAPARRAY (array, fn): converts the items in an array to another array.
Array (Array): array to be converted
Fn (Function): functions used to process array projects
Example:
MAPARRAY ([3, 4, 2, 3, 6, 8, 7], "item! = 3 ") equal to [false, true, true, false, true].
RANGE
The RANGE (from, to, step) function indicates a sequence of numbers starting from integer from, taking step as an example of each step: until an integer.
Note:
The RANGE function has three parameters.
RANGE (to). The default value is from 1 and step 1.
RANGE (from, to). The default step is 1.
RANGE (from, to, step). For more information about the parameters, see the preceding annotations.
Example:
RANGE (4) Returns [1, 2, 4].
RANGE (-5) Returns [].
RANGE (-1, 3) Returns [-1, 0, 1, 2, 3].
RANGE () Returns [,].
RANGE (6,-1,-2) Returns [6, 4, 2, 0].
RANGE (4,1, 1) Returns [].
REMOVEARRAY
REMOVEARRAY (array, start, deleteCount): deletes the deleteCount array elements starting with the start element from the array and returns the deleted array.
Example:
REMOVEARRAY ([3, 4, 4, 2, 6, 7, 87], 4, 2) Returns [3, 4, 4, 7, 87].
REVERSEARRAY
REVERSEARRAY (array): returns the reverse array of the array.
Example:
REVERSEARRAY (["first", "second", "third"]) Returns ["third", "second", "first"].
SLICEARRAY
SLICEARRAY (array, start, end): returns the array from the start to the end (including the end element ).
Example:
SLICEARRAY ([3, 4, 5, 1, 5, 7], 3, 6) Returns [4, 5, 1, 5].
If the end parameter is not used, elements between start and end of the array are returned.
SLICEARRAY ([3, 4, 5, 1, 5, 7], 3) Returns [4, 5, 1, 5, 7].
SORTARRAY
SORTARRAY (array): returns an array in ascending order.
Example:
SORTARRAY ([3, 4, 5, 1, 5, 7]) Returns [1, 3, 4, 4, 5, 5, 7].
Note: The Element Types of the array must be the same and can be compared.
UNIQUEARRAY
UNIQUEARRAY (array): removes repeated elements from the array.
Example:
UNIQUEARRAY ([14,2, 3, 4, 3, 2, 5, 6, 2, 7, 9, 12, 3]) Returns [14, 2, 3, 4, 5, 6, 7, 9, 12].