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

IndexVector class

IndexVector is a simple vector implementation that returns the index value for each element in the vector. It is functionally equivolant a vector backed by an array with values: [0,1,2,...,length-1]

Signature

typescript
export declare class IndexVector extends FunctionalVector<number> 

Import

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

Constructors

ConstructorModifiersDescription
constructor(len)Constructs a new instance of the IndexVector class

Properties

PropertyModifiersTypeDescription
lengthnumber

Methods

MethodModifiersDescription
get(index)
newField(len)staticReturns a field representing the range [0 … length-1]

constructor(len)

Constructs a new instance of the IndexVector class

Signature

typescript
constructor(len: number);

Parameters

ParameterTypeDescription
lennumber

length property

Signature

typescript
get length(): number;

get method

Signature

typescript
get(index: number): number;

Parameters

ParameterTypeDescription
indexnumber

Returns:

number

newField method

Returns a field representing the range [0 … length-1]

Signature

typescript
static newField(len: number): Field<number>;

Parameters

ParameterTypeDescription
lennumber

Returns:

Field<number>