KSLMaps
object KSLMaps
Functions
Link copied to clipboard
fun flattenMap(inMap: Map<String, Map<String, Double>>, catChars: String): LinkedHashMap<String, Double>
Takes the double map and creates a single map by forming unique keys from the double map keys. Use a concatenation string that does not appear within the keys of the inMap and for which a unique key will be formed from the two keys.
Link copied to clipboard
Creates a LinkedHashMap to preserve order. If the value is NaN, then the entry is not added to the map.
Link copied to clipboard
Converts a map that has (String, Double) pairs to a JSON string
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun unflattenMap(inMap: Map<String, Double>, catChars: Char): LinkedHashMap<String, MutableMap<String, Double>>
Reverses the operation of un-flatten using the provided catChars. Assumes that the catChars will slit the keys of the map into two separate strings that can be used as keys into the returned double map. A duplicate key within the inner map will result in an exception.