API Reference
@univerjs
@univerjs/core
classes
Lrumap

@univerjs/core v0.4.2Docs


Class: LRUMap<K, V>

Type Parameters

Type Parameter
K
V

Constructors

new LRUMap()

new LRUMap<K, V>(entries): LRUMap<K, V>

Parameters

ParameterType
entriesIterable<[K, V]>

Returns

LRUMap<K, V>

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:136 (opens in a new tab)

new LRUMap()

new LRUMap<K, V>(limit): LRUMap<K, V>

Parameters

ParameterType
limitnumber

Returns

LRUMap<K, V>

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:137 (opens in a new tab)

new LRUMap()

new LRUMap<K, V>(limit, entries): LRUMap<K, V>

Parameters

ParameterType
limitnumber
entriesIterable<[K, V]>

Returns

LRUMap<K, V>

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:138 (opens in a new tab)

Properties

PropertyTypeDefault valueDefined in
limitnumberundefinedsubmodules/univer/packages/core/src/shared/lru/lru-map.ts:118 (opens in a new tab)
newestundefined | Entry<K, V>undefinedsubmodules/univer/packages/core/src/shared/lru/lru-map.ts:122 (opens in a new tab)
oldestundefined | Entry<K, V>undefinedsubmodules/univer/packages/core/src/shared/lru/lru-map.ts:120 (opens in a new tab)
sizenumber0submodules/univer/packages/core/src/shared/lru/lru-map.ts:116 (opens in a new tab)

Methods

[iterator]()

iterator: Iterator<[K, V], undefined | [K, V], undefined>

Returns

Iterator<[K, V], undefined | [K, V], undefined>

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:345 (opens in a new tab)


_initialize()

_initialize(limit, entries): void

Parameters

ParameterType
limitnumber
entriesundefined | Iterable<[K, V]>

Returns

void

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:160 (opens in a new tab)


_markEntryAsUsed()

_markEntryAsUsed(entry): void

Parameters

ParameterType
entryEntry<K, V>

Returns

void

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:175 (opens in a new tab)


assign()

assign(entries): void

Parameters

ParameterType
entriesIterable<[K, V]>

Returns

void

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:201 (opens in a new tab)


clear()

clear(): void

Returns

void

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:325 (opens in a new tab)


delete()

delete(key): undefined | V

Parameters

ParameterType
keyK

Returns

undefined | V

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:298 (opens in a new tab)


entries()

entries(): Iterator<[K, V], undefined | [K, V], undefined>

Returns

Iterator<[K, V], undefined | [K, V], undefined>

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:341 (opens in a new tab)


find()

find(key): undefined | V

Parameters

ParameterType
keyK

Returns

undefined | V

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:293 (opens in a new tab)


forEach()

forEach(fun, thisObj?): void

Parameters

ParameterType
fun(value, key, m) => void
thisObj?any

Returns

void

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:349 (opens in a new tab)


get()

get(key): undefined | V

Parameters

ParameterType
keyK

Returns

undefined | V

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:280 (opens in a new tab)


has()

has(key): boolean

Parameters

ParameterType
keyK

Returns

boolean

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:289 (opens in a new tab)


keys()

keys(): Iterator<K, undefined | K, undefined>

Returns

Iterator<K, undefined | K, undefined>

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:333 (opens in a new tab)


onShift()

onShift(callback): IDisposable

Parameters

ParameterType
callback(entry) => void

Returns

IDisposable

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:126 (opens in a new tab)


set()

set(key, value): LRUMap<K, V>

Parameters

ParameterType
keyK
valueV

Returns

LRUMap<K, V>

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:224 (opens in a new tab)


shift()

shift(): undefined | [K, V]

Returns

undefined | [K, V]

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:257 (opens in a new tab)


toJSON()

toJSON(): {
  key: K;
  value: V;
 }[]

Returns

{ key: K; value: V; }[]

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:360 (opens in a new tab)


toString()

toString(): string

Returns

string

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:371 (opens in a new tab)


values()

values(): Iterator<V, undefined | V, undefined>

Returns

Iterator<V, undefined | V, undefined>

Defined in

submodules/univer/packages/core/src/shared/lru/lru-map.ts:337 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.