Capítulo 748 de 859

Chapter 748: NodeCache

Core Idea

This utility class is used in NodeBuilder as an internal cache data structure for node data.

Key Concepts

  • id : number (readonly): The id of the cache.
  • nodesData : WeakMap.<Node, Object>: A weak map for managing node data.
  • parent : NodeCache: Reference to a parent node cache.

Reference Tables

Constructor

Signature
new NodeCache( parent : NodeCache )

Properties

PropertyDescription
.id : number (readonly)The id of the cache.
.nodesData : WeakMap.<Node, Object>A weak map for managing node data.
.parent : NodeCacheReference to a parent node cache.

Methods

MethodDescription
.getData( node : Node ) : ObjectReturns the data for the given node.
.setData( node : Node, data : Object )Sets the data for a given node.

Key Takeaways

  1. Most relevant properties: id, nodesData, parent.
  2. Key methods: getData, setData.

Connects To