Home

# Class goog.ds.SortedNodeList

Node list implementation which maintains sort order during insertion and modification operations based on a comparison function. The SortedNodeList does not guarantee sort order will be maintained if the underlying data nodes are modified externally. Names that are reserved for system use and shouldn't be used for data node names: eval, toSource, toString, unwatch, valueOf, watch. Behavior is undefined if these names are used.

extends goog.ds.BasicNodeList

Instance Method Summary
| `add(?goog.ds.DataNode node)` Add a node to the node list, maintaining sort order. If the node has a dataName, uses this for the key in the map.
| `append(?goog.ds.DataNode node)` Adds the given node to the end of the SortedNodeList. This should only be used when the caller can guarantee that the sort order will be maintained according to this SortedNodeList's compareFn (e.g. when initializing a new SortedNodeList from a list of nodes that has already been sorted).
| `setNode(string name, ?goog.ds.DataNode node)` Sets a node in the list of a given name, maintaining sort order.