The goog.structs.InversionMap Class

goog.structs.InversionMap(rangeArray, valueArray, opt_delta)

Maps ranges to values using goog.structs.Inversion.

rangeArray {Array.<number>}
An array of monotonically increasing integer values, with at least one instance.
valueArray {Array.<*>}
An array of corresponding values. Length must be the same as rangeArray.
opt_delta {boolean=}
If true, saves only delta from previous value.

.at(intKey)

Gets the value corresponding to a number from the inversion map.

intKey {number}
The number for which value needs to be retrieved from inversion map.
returns {*}
Value retrieved from inversion map; null if not found.

.spliceInversion(rangeArray, valueArray, opt_delta)

Splices a range -> value map into this inversion map.

rangeArray {Array.<number>}
An array of monotonically increasing integer values, with at least one instance.
valueArray {Array.<*>}
An array of corresponding values. Length must be the same as rangeArray.
opt_delta {boolean=}
If true, saves only delta from previous value.