|
|||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||||
See:
Description
| Function Summary | ||
|---|---|---|
|
all(predicate: (T) -> Boolean): Boolean
Returns true if the element is not null and matches the given predicate |
|
|
any(predicate: (T) -> Boolean): Boolean
Returns true if the element is not null and matches the given predicate |
|
|
count(predicate: (T) -> Boolean): Int
Returns the 1 if the element is not null else 0 |
|
|
filter(predicate: (T) -> Boolean): T?
Returns a new List containing all elements in this collection which match the given predicate |
|
|
filterNot(predicate: (T) -> Boolean): Collection<T>
Returns a new collection containing all elements in this collection which do not match the given predicate |
|
|
filterNotNull(): Collection<T>
Returns a List containing all the non null elements in this collection |
|
|
filterNotNullTo(result: C): C
Filters all the null elements in this collection winto the given result collection |
|
|
filterNotTo(result: C, predicate: (T) -> Boolean): C
Returns a new collection containing all elements in this collection which do not match the given predicate |
|
|
filterTo(result: C, predicate: (T) -> Boolean): C
Filters all elements in this collection which match the given predicate into the given result collection |
|
|
find(predicate: (T) -> Boolean): T?
Returns the first item which matches the predicate if this element is not null else null |
|
|
flatMap(transform: (T) -> MutableCollection<R>): Collection<R>
Returns the result of transforming each item in the collection to a one or more values which are concatenated together into a single collection |
|
|
flatMapTo(result: MutableCollection<R>, transform: (T) -> MutableCollection<R>): Collection<R>
Returns the result of transforming each item in the collection to a one or more values which are concatenated together into a single collection |
|
|
fold(initial: T, operation: (T, T) -> T): T
Folds all the values from from left to right with the initial value to perform the operation on sequential pairs of values |
|
|
foldRight(initial: T, operation: (T, T) -> T): T
Folds all the values from right to left with the initial value to perform the operation on sequential pairs of values |
|
|
forEach(operation: (T) -> Unit): Unit
Performs the given operation on each element inside the collection |
|
|
groupBy( [result: MutableMap<K, MutableList<T>>], toKey: (T) -> K): Map<K, MutableList<T>>
Iterates through the collection performing the transformation on each element and using the result as the key in a map to group elements by the result |
|
|
makeString( [separator: String, prefix: String, postfix: String]): String
Creates a String from the nullable or item with the given prefix and postfix if supplied |
|
|
map(transform: (T) -> R): R?
Returns the nullable result of transforming this with the given transformation function |
|
|
mapTo(result: C, transform: (T) -> R): C
Transforms each element of this collection with the given function then adds the results to the given collection |
|
|
reverse(): T?
Returns itself since it can’t be reversed as it can contain at most one item |
|
|
toCollection(result: C): C
Copies the collection into the given collection |
|
|
toLinkedList(): LinkedList<T>
Converts the collection into a LinkedList |
|
|
toList(): List<T>
Converts the collection into a List |
|
|
toSet(): Set<T>
Converts the collection into a Set |
|
|
toSortedSet(): SortedSet<T>
Converts the collection into a SortedSet |
|
| Extensions Summary | |
|---|---|
| jet.Any | hashCodeOrDefault |
| Function Detail |
|---|
fun <T> T?.all(predicate: (T) -> Boolean): Boolean
Returns true if the element is not null and matches the given predicate
fun <T> T?.any(predicate: (T) -> Boolean): Boolean
Returns true if the element is not null and matches the given predicate
fun <T> T?.count(predicate: (T) -> Boolean): Int
Returns the 1 if the element is not null else 0
fun <T> T?.filter(predicate: (T) -> Boolean): T?
Returns a new List containing all elements in this collection which match the given predicate
fun <T> T?.filterNot(predicate: (T) -> Boolean): Collection<T>
Returns a new collection containing all elements in this collection which do not match the given predicate
fun <T> T?.filterNotNull(): Collection<T>
Returns a List containing all the non null elements in this collection
fun <T, C> T?.filterNotNullTo(result: C): C
Filters all the null elements in this collection winto the given result collection
fun <T, C> T?.filterNotTo(result: C, predicate: (T) -> Boolean): C
Returns a new collection containing all elements in this collection which do not match the given predicate
fun <T, C> T?.filterTo(result: C, predicate: (T) -> Boolean): C
Filters all elements in this collection which match the given predicate into the given result collection
fun <T> T?.find(predicate: (T) -> Boolean): T?
Returns the first item which matches the predicate if this element is not null else null
fun <T, R> T?.flatMap(transform: (T) -> MutableCollection<R>): Collection<R>
Returns the result of transforming each item in the collection to a one or more values which
are concatenated together into a single collection
fun <T, R> T?.flatMapTo(result: MutableCollection<R>, transform: (T) -> MutableCollection<R>): Collection<R>
Returns the result of transforming each item in the collection to a one or more values which
are concatenated together into a single collection
fun <T> T?.fold(initial: T, operation: (T, T) -> T): T
Folds all the values from from left to right with the initial value to perform the operation on sequential pairs of values
For example to sum together all numeric values in a collection of numbers it would be
{code}val total = numbers.fold(0){(a, b) -> a + b}{code}
fun <T> T?.foldRight(initial: T, operation: (T, T) -> T): T
Folds all the values from right to left with the initial value to perform the operation on sequential pairs of values
fun <T> T?.forEach(operation: (T) -> Unit): Unit
Performs the given operation on each element inside the collection
fun <T, K> T?.groupBy( [result: MutableMap<K, MutableList<T>>], toKey: (T) -> K): Map<K, MutableList<T>>
Iterates through the collection performing the transformation on each element and using the result
as the key in a map to group elements by the result
fun <T> T?.makeString( [separator: String, prefix: String, postfix: String]): String
Creates a String from the nullable or item with the given prefix and postfix if supplied
fun <T, R> T?.map(transform: (T) -> R): R?
Returns the nullable result of transforming this with the given transformation function
fun <T, R, C> T?.mapTo(result: C, transform: (T) -> R): C
Transforms each element of this collection with the given function then adds the results to the given collection
fun <T> T?.reverse(): T?
Returns itself since it can’t be reversed as it can contain at most one item
fun <T, C> T?.toCollection(result: C): C
Copies the collection into the given collection
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||