Class: SizeExtractor

SizeExtractor()

Extractor for retrieving and caching the size of a subtree.

Constructor

new SizeExtractor()

Create a new SizeExtractor instance
Implements:
Source:

Classes

SizeExtractor

Members

(protected) _memo :Map.<Node, Number>

Type:
  • Map.<Node, Number>
Source:

Methods

(protected) _extract(node)

Extract the size for a subtree and cache it.
Parameters:
Name Type Description
node Node The root node of the subtree.
Source:

get(node) → {Number}

Get the cached size of a subtree. If it is not cached, calculate and cache it first.
Parameters:
Name Type Description
node Node The root of the subtree
Source:
Returns:
Type
Number