Documentation / dataflow / com.femastudios.dataflow.util / DataflowCollectionUtils
Go to reference

DataflowCollectionUtils

object DataflowCollectionUtils

A utility class for dataflow collections

Functions

cloneMap

Clones the given map in a new MutableMap of the given expectedSize

fun <K, V> cloneMap(map: Map<out K, V>, expectedSize: Int = map.size, preserveOrder: Boolean = false): MutableMap<K, V>

createMap

Creates a map in the most efficient way possible. The caller should not make any assumptions on the type of map that is returned, outside the provided parameters. The current implementation can return a LinkedHashMap, Android's android.util.ArrayMap or androidx.collection.ArrayMap (if available) or a HashMap. The exact class instance returned by this method may be subject to change in the future.

fun <K, V> createMap(expectedSize: Int = -1, preserveOrder: Boolean = false): MutableMap<K, V>