IntegerIndexedObject Class
Package: @esfx/indexed-object
Represents an object that can be indexed by an integer value similar to a native Array or TypedArray.
Declaration
export declare abstract class IntegerIndexedObject<T>
Constructors
constructor()
Constructs a new instance of the IntegerIndexedObject
class
Declaration
constructor();
Methods
deleteIndex(index)
Deletes the value at the specified index.
Declaration
protected deleteIndex(index: number): boolean;
Parameters
Returns
true
if the value was successfully deleted; otherwise, false
.
getIndex(index)
Gets the value at the specified index.
Declaration
protected abstract getIndex(index: number): T;
Parameters
Returns
T
getLength()
Gets the "length" of the indexed object, which should be one more than the largest index stored in the object.
Declaration
protected abstract getLength(): number;
Returns
hasIndex(index)
Determines whether the object contains a value at the specified index.
Declaration
protected hasIndex(index: number): boolean;
Parameters
Returns
setIndex(index, value)
Sets the value at the specified index.
Declaration
protected setIndex(index: number, value: T): boolean;
Parameters
- value
- T
The value to set for the specified index.
Returns
true
if the value could be set; otherwise, false
.