This supports adding to the ‘head’ or ‘tail’ and will grow the buffer to match a configured capacity.

    Signature

    Import

    Constructors

    Properties

    PropertyModifiersTypeDescription
    add(value: T) => voidAdd the value to the buffer
    number

    Methods

    Constructs a new instance of the CircularVector class

    Signature

      Parameters

      ParameterTypeDescription
      optionsCircularOptions<T>

      add property

      Add the value to the buffer

      Signature

      1. add: (value: T) => void;

      length property

      Signature

      Parameters

      Returns:

      T

      reverse method

      Signature

      1. reverse(): void;

      Returns:

      void

      set method

      Signature

      1. set(index: number, value: T): void;

      Parameters

      ParameterTypeDescription
      indexnumber
      valueT

      Returns:

      Parameters

      Returns:

      void

      setCapacity method

      Signature

      1. setCapacity(v: number): void;

      Parameters

      ParameterTypeDescription
      vnumber

      Returns:

      void

      toArray method

      Signature

        Returns:

        T[]

        Signature

        T[]