Home

# Class goog.ds.FastDataNode

Creates a new fast data node, using the properties of root.

extends goog.ds.AbstractFastDataNode

Instance Method Summary
| `add(?goog.ds.DataNode value)` Adds a child to this data node.
| `clone() ⇒ ?goog.ds.FastDataNode` Creates a deep copy of this data node.
| `extendWith_(?Object object)` Add all attributes of object to this data node.
| `get(string= opt_key) ⇒ ?goog.ds.DataNode` Gets the value of this data node (if called without opt_key) or gets a child node (if called with opt_key).
| `getByIndex(number index) ⇒ ?goog.ds.DataNode` Gets a child node by index. This method has a complexity of O(n) where n is the number of children. If you need a faster implementation of this method, you should use goog.ds.FastListNode.
| `getChildNode(string name, boolean= opt_create) ⇒ ?goog.ds.DataNode` Get a child node by name.
| `getChildNodeValue(string name) ⇒ ?Object` Returns the value of a child node. By using this method you can avoid the need to create PrimitiveFastData nodes.
| `getChildNodes(string= opt_selector) ⇒ (goog.ds.DataNode|goog.ds.DataNodeList|null)` Returns child nodes of this data node. Currently, only supports returning all children.
| `getCount() ⇒ number` Gets the number of child nodes. This method has a complexity of O(n) where n is the number of children. If you need a faster implementation of this method, you should use goog.ds.FastListNode.
| `getJsObject() ⇒ ?Object` Returns a javascript object representation of this data node. You should not modify the object returned by this function.
| `isList() ⇒ boolean` Returns whether this data node is a list. Always returns false for instances of FastDataNode but may return true for subclasses.
| `removeNode(string name) ⇒ boolean` Removes a child node.
| `set(?Object value)` Not supported for normal FastDataNodes.
| `setChildNode(string name, ?Object value) ⇒ ?Object` Sets a child node. Creates the child if it does not exist. Calling this function makes any child nodes previously obtained for name invalid. You should not use these child nodes but instead obtain a new instance by calling getChildNode.
| `setNode(string name, ?Object value)` Sets a child node.
| `wrapChild_(string name)` Makes sure that a named child is wrapped in a data node structure.

Static Method Summary

`fromJs((Object|boolean|null|number|string) object, string dataName, ?goog.ds.DataNode= opt_parent) ⇒ ?goog.ds.AbstractFastDataNode`

Creates a new FastDataNode structure initialized from object. This will return an instance of the most suitable sub-class of FastDataNode. You should not modify object after creating a fast data node from it or assume that changing object changes the data node. Doing so results in undefined behaviour.