Overview
Library of static Sequence Utilities that can be used to perform common operations, such as adding or concatenating. Also provides a generic fold operation (ala. Haskell or ML) that can be used to reduce a generic list of Objects. Currently there is only type support for Numbers, Integers, and Objects.
Inherited Variables
Function Summary
- public characterSequence(start: java.lang.String, end: java.lang.String) : <any>[]
-
A character sequence generator.
A character sequence generator. This function generates a sequence of one-character strings starting from the first character of the
startstring and ending with the first character of theendstring.-
Parameters
- start
- The character that starts the sequence.
- end
- The character that ends the sequence.
-
Returns
- <any>[]
- A sequence of one-character strings.
- public concat(seq: java.lang.String[]) : java.lang.String
- public fold(ident: Number, seq: Number[], func: com.sun.javafx.functions.Function2) : Number
-
Generic fold function typed for Number sequences.
Generic fold function typed for Number sequences. This function takes an identity Number, a sequence of Numbers, and a reduce function, and returns a single value.
This function performs what is known as a left fold in functional languages. The basic algorithm is that the ident value and first element of the list are passed in to the given reduce function, resulting in a single value. That value is then passed together with the second element of the list back into the reduce function resulting in a single value again. This process repeats until there are no elements left in the list and a single return value results.
For a more thorough explanation of how the fold operator works, please refer to the following article: http://en.wikipedia.org/wiki/Fold_(higher-order_function)
-
Parameters
- ident
- The identity value
- seq
- A sequence of Numbers
- func
- A reduce function
-
Returns
- Number
- A single value that is the result of applying the reduce function to all the elements in the sequence.
- public fold(ident: Integer, seq: Integer[], func: com.sun.javafx.functions.Function2) : Integer
-
Generic fold function typed for Integer sequences.
Generic fold function typed for Integer sequences. This function takes an identity Integer, a sequence of Integers, and a reduce function, and returns a single value.
This function performs what is known as a left fold in functional languages. The basic algorithm is that the ident value and first element of the list are passed in to the given reduce function, resulting in a single value. That value is then passed together with the second element of the list back into the reduce function resulting in a single value again. This process repeats until there are no elements left in the list and a single return value results.
For a more thorough explanation of how the fold operator works, please refer to the following article: http://en.wikipedia.org/wiki/Fold_(higher-order_function)
-
Parameters
- ident
- The identity value
- seq
- A sequence of Integers
- func
- A reduce function
-
Returns
- Integer
- A single value that is the result of applying the reduce function to all the elements in the sequence.
- public fold(ident: java.lang.Object, seq: java.lang.Object[], func: com.sun.javafx.functions.Function2) : java.lang.Object
-
Generic fold function typed for Object sequences.
Generic fold function typed for Object sequences. This function takes an identity Object, a sequence of Objects, and a reduce function, and returns a single value.
This function performs what is known as a left fold in functional languages. The basic algorithm is that the ident value and first element of the list are passed in to the given reduce function, resulting in a single value. That value is then passed together with the second element of the list back into the reduce function resulting in a single value again. This process repeats until there are no elements left in the list and a single return value results.
For a more thorough explanation of how the fold operator works, please refer to the following article: http://en.wikipedia.org/wiki/Fold_(higher-order_function)
-
Parameters
- ident
- The identity value
- seq
- A sequence of Objects
- func
- A reduce function
-
Returns
- Object
- A single value that is the result of applying the reduce function to all the elements in the sequence.
- public join(seq: java.lang.String[], delimiter: java.lang.String) : java.lang.String
-
Joins all the elements of a String sequence using the specified delimiter String between elements.
Joins all the elements of a String sequence using the specified delimiter String between elements. Thre result is a single merged String with one less delimiter than the size of the input sequence.
-
Parameters
- seq
- A sequence of Strings
- delimiter
-
Returns
- String
- A single value joined by the delimiter
- public sum(seq: Number[]) : Number
- public sum(seq: Integer[]) : Integer