goog.ds.FastDataNode
Classgoog.ds.FastDataNode
> goog.ds.AbstractFastDataNode
> goog.ds.DataNodeList
> goog.ds.DataNode
goog.ds.FastDataNode(root, dataName, opt_parent)
Creates a new fast data node, using the properties of root.
root
{Object
}
dataName
{string
}
opt_parent
{goog.ds.DataNode
=}
.add(value)
Adds a child to this data node.
value
{goog.ds.DataNode
}
.clone()
Creates a deep copy of this data node.
goog.ds.FastDataNode
}
.extendWith_(object)
[protected]Add all attributes of object to this data node.
object
{Object
}
.fromJs(object, dataName, opt_parent)
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.
object
{Object
|number
|boolean
|string
}
dataName
{string
}
opt_parent
{goog.ds.DataNode
=}
goog.ds.AbstractFastDataNode
}
.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
=}
.getByIndex(index)
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.
index
{number
}
goog.ds.DataNode
}
.getChildNode(name, opt_create)
Get a child node by name.
name
{string
}
opt_create
{boolean
=}
goog.ds.DataNode
}
.getChildNodeValue(name)
Returns the value of a child node. By using this method you can avoid the need to create PrimitiveFastData nodes.
name
{string
}
Object
}
.getChildNodes()
.getCount()
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.
number
}
.getDataName()
Inherited from goog.ds.AbstractFastDataNode
.
Return the name of this data node.
string
}
.getDataPath()
Inherited from goog.ds.AbstractFastDataNode
.
Get the path leading to this data node.
string
}
.getJsObject()
Returns a javascript object representation of this data node. You should not modify the object returned by this function.
Object
}
.getLoadState()
Inherited from goog.ds.DataNode
.
Gets the state of the backing data for this node
goog.ds.LoadState
}
.isList()
Returns whether this data node is a list. Always returns false for instances of FastDataNode but may return true for subclasses.
boolean
}
.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 normal FastDataNodes.
value
{*}
.setChildNode()
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.
.setDataName(value)
Inherited from goog.ds.AbstractFastDataNode
.
Set the name of this data node.
value
{string
}
.setNode(name, value)
Sets a child node.
name
{string
}
value
{Object
}