structs.InversionMap Extends
Maps ranges to values.

Inheritance

Constructor

goog.structs.InversionMap(rangeArrayvalueArrayopt_delta)

Parameters

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

Instance Methods

Public Protected Private
at(intKey) T | null
Gets the value corresponding to a number from the inversion map.
Arguments:
intKey : number
The number for which value needs to be retrieved from inversion map.
Returns: T | null  Value retrieved from inversion map; null if not found.
code »
getLeast(intKey) number
Gets the largest index such that rangeArray[index] <= intKey from the inversion map.
Arguments:
intKey : number
The probe for which rangeArray is searched.
Returns: number  Largest index such that rangeArray[index] <= intKey.
code »
spliceInversion(rangeArrayvalueArrayopt_delta)
Splices a range -> value map into this inversion map.
Arguments:
rangeArray : Array.<number>
An array of monotonically increasing integer values, with at least one instance.
valueArray : Array.<T>
An array of corresponding values. Length must be the same as rangeArray.
opt_delta : boolean=
If true, saves only delta from previous value.
code »
storeInversion_(rangeArrayopt_delta)
Stores the integers as ranges (half-open). If delta is true, the integers are delta from the previous value and will be restored to the absolute value. When used as a set, even indices are IN, and odd are OUT.
Arguments:
rangeArray : Array.<?number>
An array of monotonically increasing integer values, with at least one instance.
opt_delta : boolean=
If true, saves only delta from previous value.
code »

Instance Properties

rangeArray :
No description.
Code »
values :
No description.
Code »

Package structs

Package Reference