NodeIndex
Class defined in model/data/NodeIndex.js#11
new NodeIndex()
Constructor defined in model/data/NodeIndex.js#13
this.get(path)
Method defined in model/data/NodeIndex.js#31

Get all indexed nodes for a given path.

Parameters

path | Array.<String> |

Returns

| A node or an object with ids and nodes as values.

this.getAll()
Method defined in model/data/NodeIndex.js#40

Collects nodes recursively.

Returns

| An object with ids as keys and nodes as values.

this.select()
Method defined in model/data/NodeIndex.js#63

Check if a node should be indexed.

Used internally only. Override this in subclasses to achieve a custom behavior.

Parameters

| Node |

Returns

Boolean | true if the given node should be added to the index.

this.create(node)
Method defined in model/data/NodeIndex.js#79

Called when a node has been created.

Override this in subclasses for customization.

Parameters

node | Node |

this.delete()
Method defined in model/data/NodeIndex.js#97

- Called when a node has been deleted.
- Override this in subclasses for customization.
- @private
- @param {model/data/Node} node

this.update(node)
Method defined in model/data/NodeIndex.js#115

Called when a property has been updated.

Override this in subclasses for customization.

Parameters

node | Node |

this.reset()
Method defined in model/data/NodeIndex.js#142

Reset the index using a Data instance.

this.clone()
Method defined in model/data/NodeIndex.js#152

Clone this index.

Returns

| A cloned NodeIndex.

this.property
Property defined in model/data/NodeIndex.js#50

The property used for indexing.

NodeIndex.create(prototype)
Static Method defined in model/data/NodeIndex.js#174

Create a new NodeIndex using the given prototype as mixin.

Parameters

prototype | Object |

Returns

NodeIndex | A customized NodeIndex.

NodeIndex.filterByType(type)
Static Method defined in model/data/NodeIndex.js#188

Create a filter to filter nodes by type.

Parameters

type | String |

Returns

function |