-
public final class CollectionExtensionsKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> UnitsetAll(List<T> $self, Collection<T> other)Replaces all of the elements of this MutableList with the elements of the provided collection. final static <K extends Any, V extends Any> UnitsetAll(Map<K, V> $self, Map<K, V> other)Replaces all of the elements of this MutableMap with the elements of the provided map. final static <T extends Any> UnitsetAll(List<T> $self, Array<out T> other)Replaces all of the elements of this MutableList with the elements of the provided array. final static <T extends Any> Unit,List)>setToAllChildren(<ERROR CLASS><<ERROR CLASS><T>> $self, List<Collection<T>> other)For each child ArrayList contained in this ArrayList, replaces the elements of the child ArrayList with the elements of the corresponding Collection from the provided List. final static <T extends Any> FloatsumByFloat(Iterable<T> $self, Function1<T, Float> selector)Calls the selector function for each value in the collection and returns the sum of the produced Floats. final static <T extends Any> UnitforEachIndexedExtended(Iterable<T> $self, Function4<Integer, Boolean, Boolean, T, Unit> selector)Calls the selector function for each element in the collection, providing the index of the element and Booleans indicating whether the element is the first or last element in the collection. final static <T extends Any> FloatsumOf(Iterable<T> $self, Function1<T, Float> selector)Calls the selector function for each value in the collection and returns the sum of the produced values. final static <T extends Any> List<T>mutableListOf(Collection<T> sourceCollection)Creates a MutableList containing all elements of the specified source collection. -
-
Method Detail
-
setAll
final static <T extends Any> Unit setAll(List<T> $self, Collection<T> other)
Replaces all of the elements of this MutableList with the elements of the provided collection.
-
setAll
final static <K extends Any, V extends Any> Unit setAll(Map<K, V> $self, Map<K, V> other)
Replaces all of the elements of this MutableMap with the elements of the provided map.
-
setAll
final static <T extends Any> Unit setAll(List<T> $self, Array<out T> other)
Replaces all of the elements of this MutableList with the elements of the provided array.
-
setToAllChildren
final static <T extends Any> Unit ,List)>setToAllChildren(<ERROR CLASS><<ERROR CLASS><T>> $self, List<Collection<T>> other)
For each child ArrayList contained in this ArrayList, replaces the elements of the child ArrayList with the elements of the corresponding Collection from the provided List. The child ArrayList and Collection are associated by index. If a given child ArrayList contained in this ArrayList has no corresponding Collection in the provided List, the child ArrayList will be cleared. If the size of this ArrayList is smaller than the size of the provided List, an appropriate number of empty child ArrayLists will first be added to this ArrayList.
-
sumByFloat
final static <T extends Any> Float sumByFloat(Iterable<T> $self, Function1<T, Float> selector)
Calls the selector function for each value in the collection and returns the sum of the produced Floats.
-
forEachIndexedExtended
final static <T extends Any> Unit forEachIndexedExtended(Iterable<T> $self, Function4<Integer, Boolean, Boolean, T, Unit> selector)
Calls the selector function for each element in the collection, providing the index of the element and Booleans indicating whether the element is the first or last element in the collection.
-
sumOf
final static <T extends Any> Float sumOf(Iterable<T> $self, Function1<T, Float> selector)
Calls the selector function for each value in the collection and returns the sum of the produced values.
-
mutableListOf
final static <T extends Any> List<T> mutableListOf(Collection<T> sourceCollection)
Creates a MutableList containing all elements of the specified source collection.
-
-
-
-