The goog.ds.FastListNode Class

goog.ds.FastListNode
> goog.ds.AbstractFastDataNode
> goog.ds.DataNodeList
> goog.ds.DataNode

goog.ds.FastListNode(values, dataName, opt_parent)

Creates a new list node from an array.

values {Array}
values hold by this list node.
dataName {string}
name of this node.
opt_parent {goog.ds.DataNode=}
parent of this node.

.add(value)

Adds a child to this data node

value {goog.ds.DataNode}
Child node to add.

.get(opt_key)

Gets the value of this data node (if called without opt_key) or gets a child node (if called with opt_key).

opt_key {string=}
Name of child node.
returns {Array|goog.ds.DataNode}
Array of child nodes (if called without opt_key), or a named child node otherwise.

.getByIndex(index)

Gets a child node by (numeric) index.

index {number}
Index of child node (starting from 0).
returns {goog.ds.DataNode}
Child node at specified index.

.getChildNode(key, opt_create)

Get a child node by name.

key {string}
Name of child node.
opt_create {boolean=}
Whether to create the child if it does not exist.
returns {goog.ds.DataNode}
Child node.

.getChildNodeValue(key)

Returns the value of a child node.

key {string}
Name of child node.
returns {*}
Value of child node.

.getChildNodes()

Returns child nodes of this data node. Currently, only supports returning all children.

returns {goog.ds.DataNodeList}
List of child nodes.

.getCount()

Gets the number of child nodes.

returns {number}
Number of child nodes.

.getDataName()

Inherited from goog.ds.AbstractFastDataNode .

Return the name of this data node.

returns {string}
Name of this data noden.

.getDataPath()

Inherited from goog.ds.AbstractFastDataNode .

Get the path leading to this data node.

returns {string}
Data path.

.getJsObject()

Returns a javascript object representation of this data node. You should not modify the object returned by this function.

returns {Object}
Javascript object representation of this data node.

.getLoadState()

Inherited from goog.ds.DataNode .

Gets the state of the backing data for this node

returns {goog.ds.LoadState}
The state.

.indexOf(name)

Returns the index of a named child nodes. This method only works if this list uses mixed name/indexed lookup, i.e. if its child node have an 'id' attribute.

name {string}
Name of child node to determine index of.
returns {number}
Index of child node named name.

.isList()

Returns whether this data node is a list. Always returns true.

returns {boolean}
Whether this data node is array-like.

.load()

Inherited from goog.ds.DataNode .

Load or reload the backing data for this node

.removeNode()

Removes a child node.

.set(value)

Not supported for FastListNodes.

value {*}
Value to set data node to.

.setChildNode()

Sets a child node. Creates the child if it does not exist. To set children at a certain index, use a key of the form '[index]'. Note, that you can only set values at existing numeric indices. To add a new node to this list, you have to use the add method. 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.

.setDataName(value)

Inherited from goog.ds.AbstractFastDataNode .

Set the name of this data node.

value {string}
Name.

.setNode(name, value)

Sets a child node.

name {string}
Name of child node.
value {Object}
Value of child node.