Menu

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Enterprise Open source

ArrayVector class

Signature

typescript
export declare class ArrayVector<T = any> extends FunctionalVector<T> implements MutableVector<T> 

Import

typescript
import { ArrayVector } from '@grafana/data';

Constructors

ConstructorModifiersDescription
constructor(buffer)Constructs a new instance of the ArrayVector class

Properties

PropertyModifiersTypeDescription
bufferT[]
lengthnumber

Methods

MethodModifiersDescription
add(value)
get(index)
reverse()
set(index, value)
toArray()
toJSON()

constructor(buffer)

Constructs a new instance of the ArrayVector class

Signature

typescript
constructor(buffer?: T[]);

Parameters

ParameterTypeDescription
bufferT[]

buffer property

Signature

typescript
buffer: T[];

length property

Signature

typescript
get length(): number;

add method

Signature

typescript
add(value: T): void;

Parameters

ParameterTypeDescription
valueT

Returns:

void

get method

Signature

typescript
get(index: number): T;

Parameters

ParameterTypeDescription
indexnumber

Returns:

T

reverse method

Signature

typescript
reverse(): void;

Returns:

void

set method

Signature

typescript
set(index: number, value: T): void;

Parameters

ParameterTypeDescription
indexnumber
valueT

Returns:

void

toArray method

Signature

typescript
toArray(): T[];

Returns:

T[]

toJSON method

Signature

typescript
toJSON(): T[];

Returns:

T[]