Index Class

    Package: @esfx/interval

    Represents an ordinal index within an indexed collection.

    Declaration
    export declare class Index implements Equatable 

    Constructors

    constructor(value, isFromEnd)

    Constructs a new instance of the Index class

    Declaration
    constructor(value: number, isFromEnd?: boolean);
    Parameters
    value
    number

    isFromEnd
    boolean

    Properties

    end

    Gets an Index representing the last element of an indexed collection.

    Declaration
    static get end(): Index;
    Property Value
    Index

    isFromEnd

    Gets a value indicating whether the index value is relative to the end of the collection.

    Declaration
    get isFromEnd(): boolean;
    Property Value
    boolean

    start

    Gets an Index representing the first element of an indexed collection.

    Declaration
    static get start(): Index;
    Property Value
    Index

    value

    Gets the value for the index.

    Declaration
    get value(): number;
    Property Value
    number

    Methods

    [Equatable.equals](other)

    Declaration
    [Equatable.equals](other: unknown): boolean;
    Parameters
    other
    unknown

    Returns
    boolean

    [Equatable.hash]()

    Declaration
    [Equatable.hash](): number;
    Returns
    number

    equals(other)

    Declaration
    equals(other: Index): boolean;
    Parameters
    other
    Index

    Returns
    boolean

    fromEnd(value)

    Creates an index relative to the end of an indexed collection.

    Declaration
    static fromEnd(value: number): Index;
    Parameters
    value
    number

    Returns
    Index

    fromStart(value)

    Creates an index relative to the start of an indexed collection.

    Declaration
    static fromStart(value: number): Index;
    Parameters
    value
    number

    Returns
    Index

    getIndex(length)

    Computes the index based on a fixed length.

    Declaration
    getIndex(length: number): number;
    Parameters
    length
    number

    The number of elements in the collection.

    Returns
    number

    hash()

    Declaration
    hash(): number;
    Returns
    number

    toString()

    Declaration
    toString(): string;
    Returns
    string

    Generated by DocFX