Class default

FIFO cache implementation in three.js that is used to cache THREE.Object3D instances.s Items cached in object hash and age managed by linked list for O(1) performance.

THis class can be used to cache any JavaScript object. However, the TypeScript is written in a three.js context.

Author

André Wisén

Copyright

MIT

Hierarchy

  • default

Constructors

Properties

cache: {
    [key: string]: Node;
} = {}

Cache.

Type declaration

  • [key: string]: Node
cacheSize: number = 0
head: null | Node = null

Head Node.

maxItems: number

Max items in cache.

tail: null | Node = null

Tail Node.

Methods

  • Update position(s).

    Type Parameters

    • T = Value

    Parameters

    • node: Node<T>

    Returns void

  • Get a a value from the cache. Returns null if it's a cache miss.

    Type Parameters

    • T = Value

    Parameters

    • key: string

    Returns null | T

  • Make a cache node.

    Type Parameters

    • T = Value

    Parameters

    • opts: Node<T>
    • spareNode: Node<T>

    Returns Node<T>

    Returnss

  • Put a new value into the cache.

    Type Parameters

    • T = Value

    Parameters

    • key: string
    • value: T

    Returns void

  • Update position(s).

    Type Parameters

    • T = Value

    Returns Node<T>

  • Parameters

    • maxItems: number

    Returns void

    Deprecated

    WIP

Generated using TypeDoc