This internal class maintains a pool of deleted nodes for reuse by the framework. This reduces the overhead from object creation and garbage collection.

Because nodes may be deleted from a NodeList while in use, by deleting Nodes from a NodeList while iterating through the NodeList, the pool also maintains a cache of nodes that are added to the pool but should not be reused yet. They are then released into the pool by calling the releaseCache method.

Constructor

new (nodeClass:Class<TNode>, components:ClassMap<Class<Dynamic>, String>)

Creates a pool for the given node class.

Methods

cache (node:TNode):Void

Adds a node to the cache

dispose (node:TNode):Void

Adds a node to the pool.

get ():TNode

Fetches a node from the pool.

releaseCache ():Void

Releases all nodes from the cache into the pool