序列

Example

import * as sequence from 'sequence';

let seq = new sequence.Sequence();

let key = "A";

for (let i=0; i < 10; i++) {
let v = seq.next(key);
console.log(v);
}

let keyB = "B";
console.log(seq.next(keyB));

Constructors

Methods

Constructors

Methods

  • clear sequence

    Parameters

    • key: string

      key of sequence

    Returns void

  • get next number of the sequence

    Parameters

    • key: string

      key of sequence

    Returns number

  • set key to specified value

    Parameters

    • key: string

      key of sequence

    • value: number

      current value of key

    Returns void