goog.ds.SortedNodeList
Classgoog.ds.SortedNodeList
> goog.ds.BasicNodeList
> goog.ds.DataNodeList
> goog.ds.DataNode
goog.ds.SortedNodeList(compareFn, opt_nodes)
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.
compareFn
{Function
}
opt_nodes
{Array
.<goog.ds.DataNode
>=}
.add(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.
node
{goog.ds.DataNode
}
.append(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).
node
{goog.ds.DataNode
}
.get(key)
Inherited from goog.ds.BasicNodeList
.
Get a node by string key. Returns null if node doesn't exist.
key
{string
}
goog.ds.DataNode
}
.getByIndex(index)
Inherited from goog.ds.BasicNodeList
.
Get a node by index Returns null if the index is out of range
index
{number
}
goog.ds.DataNode
}
.getChildNode(name, opt_canCreate)
Inherited from goog.ds.DataNode
.
Gets a named child node of the current node
name
{string
}
opt_canCreate
{boolean
=}
goog.ds.DataNode
}
.getChildNodeValue(name)
Inherited from goog.ds.DataNode
.
Gets the value of a child node
name
{string
}
.getChildNodes(opt_selector)
Inherited from goog.ds.DataNode
.
Gets all of the child nodes of the current node. Should return an empty DataNode list if no child nodes.
opt_selector
{string
=}
goog.ds.DataNodeList
}
.getCount()
Inherited from goog.ds.BasicNodeList
.
Gets the size of the node list
number
}
.getDataName()
Inherited from goog.ds.DataNode
.
Get the name of the node relative to the parent node
string
}
.getDataPath()
Inherited from goog.ds.DataNode
.
Gets the a qualified data path to this node
string
}
.getLoadState()
Inherited from goog.ds.DataNode
.
Gets the state of the backing data for this node
goog.ds.LoadState
}
.indexOf(name)
Inherited from goog.ds.BasicNodeList
.
Get the index of a named node
name
{string
}
number
|undefined
}
.isList()
Inherited from goog.ds.DataNode
.
Whether the value of this node is a homogeneous list of data
boolean
}
.load()
Inherited from goog.ds.DataNode
.
Load or reload the backing data for this node
.removeNode(name)
Inherited from goog.ds.BasicNodeList
.
Removes a node in the list of a given name
name
{string
}
boolean
}
.set(value)
Inherited from goog.ds.DataNode
.
Set the value of the node
value
{*}
.setChildNode(name, value)
Inherited from goog.ds.DataNode
.
Sets a named child node of the current node.
name
{string
}
value
{Object
}
Object
}
.setDataName(name)
Inherited from goog.ds.DataNode
.
Set the name of the node relative to the parent node
name
{string
}
.setNode(name, node)
Sets a node in the list of a given name, maintaining sort order.
name
{string
}
node
{goog.ds.DataNode
}