pdk.flow.Array
contains functions that can be applied to pdk.core.Array variables
All functions
add
Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
Arguments:
array :: pdk.core.Array<T>
index :: pdk.core.Integer
element :: T
Result:
No variable is returned. The input array contains the new element in the defined position.
Possible exceptions
IndexOutOfBoundsException - throws if the index is greater than the length of the array
NullPointerException - throws if the input array is
NULL
Example:
addAllElements
Appends the specified array to the end of the source array
Arguments:
array :: pdk.core.Array<T>
arrayToAppend :: pdk.core.Array<T>
Result:
No variable is returned. The first array contains all elements from the second one.
Possible exceptions
NullPointerException - throws if the input array is
NULL
Example
addElement
Appends the specified element to the end of the source array.
Arguments:
array :: pdk.core.Array<T>
element :: T
Result:
No variable is returned. The input array contains the element.
Possible exceptions
NullPointerException - throws if the input array is
NULL
Example
clear
Removes all of the elements from the input array. The array will be empty after this call returns.
Arguments:
array :: pdk.core.Array<T>
Result:
No variable is returned. Input array is empty.
Possible exceptions
NullPointerException - throws if the input array is
NULL
Example
copy
Creates and returns a copy of the input array.
Arguments:
array :: pdk.core.Array<T>
Result:
output :: pdk.core.Array<T>
Example
intersection
Returns a new array containing all elements that are contained in both given arrays.
Arguments:
firstArray :: pdk.core.Array<T>
secondArray :: pdk.core.Array<T>
Result:
output :: pdk.core.Array<T>
Possible exceptions
NullPointerException - throws if any of the input arrays is
NULL
Example
partition
Returns consecutive subarrays of an array, each of the same size (the final array may be smaller). For example, partitioning an array containing [a, b, c, d, e] with a partition size of 3 yields [[a, b, c], [d, e]] -- an outer array containing two inner arrays of three and two elements, all in the original order.
Arguments:
array :: pdk.core.Array<T>
size :: pdk.core.Integer
Result:
output :: pdk.core.Array<Array<T>>
Possible exceptions
NullPointerException - throws if the input array is
NULL
Example
removeElementAtIndex
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).
Arguments:
array :: pdk.core.Array<T>
index :: pdk.core.Integer
Result:
No variable is returned. The element is removed from the list.
Possible exceptions
IndexOutOfBoundsException - throws if the index is greater than the length of the array
NullPointerException - throws if the input array is
NULL
Example
set
Replaces the element at the specified position in this list with the specified element and returns the element previously at the specified position.
Arguments:
array :: pdk.core.Array<T>
index :: pdk.core.Integer
element :: T
Result:
output :: T
Possible exceptions
IndexOutOfBoundsException - throws if the index is greater than the length of the array
NullPointerException - throws if the input array is
NULL
Example
sortDates
Sorts array of dates in specified order.
Arguments:
array :: pdk.core.Array<pdk.core.Date>
ascending :: pdk.core.Boolean
Result:
No variable is returned. Input array is sorted.
Possible exceptions
NullPointerException - throws if the input array or ascending parameter is
NULL
Example
sortNumbers
Sorts array of numbers in specified order.
Arguments:
array :: pdk.core.Array<pdk.core.Number>
ascending :: pdk.core.Boolean
Result:
No variable is returned. Input array is sorted.
Possible exceptions
NullPointerException - throws if the input array or ascending parameter is
NULL
Example
sortStrings
Sorts array of string in specified order.
Arguments:
array :: pdk.core.Array<pdk.core.String>
ascending :: pdk.core.Boolean
Result:
No variable is returned. Input array is sorted.
Possible exceptions
NullPointerException - throws if the input array or ascending parameter is
NULL
Example
sum
Returns the sum of the given arrays. This is their intersection subtracted from their union.
Arguments:
array1 :: pdk.core.Array<T>
array2 :: pdk.core.Array<T>
Result:
output :: pdk.core.Array<T>
Possible exceptions
NullPointerException - throws if any of the input arrays is
NULL
Example
Last updated