Sydney

Class Composite

Object
   |
   +--Composite

class Composite

Defined in composite.js


Constructor Summary
Composite (<string> name, <Object> value)
            Creates a composite.
 
Method Summary
 void addChild(<Composite> child)
           Adds the given Composite node to this node's list of children.
 void addChildren(<AbstractList> list)
           Iteratively adds the contents of list to this node's child list.
 void apply(<Function> preFunc, <Function> postFunc)
           Visits each node in the composite tree and calls preFunc and/or postFunc at each node.
 void clear()
           Empties this node's child list.
 Composite clone(<int> depth, <string> newName)
           Clones this node, optionally cloning its children.
 boolean contains(<string> path)
           Returns true if this node or one of its descendants can be found using the given path and false otherwise.
 boolean containsNodeWithValue(<string> path, <string> value)
           Returns true if this node or one of its descendants has a path matching path and a value matching value.
 Composite createPath(<string> path)
           Creates and inserts enough Composites to make sure that this.findFirst(path) will return a non-null value.
 Object diff(<Composite> other)
           First stab at a tree-based diff function.
 AbstractList find(<string> path, <Function> hash)
           Finds and returns all nodes beneath this one that have a path equal to path, relative to this node.
 Composite findByIndex(<string> path, <int> index)
           Finds and returns the indexth node beneath this one that has a path equal to path.
 Composite findFirst(<string> path)
           Finds and returns the first node beneath this one that has a path equal to path.
 Composite findFirstNodeWithValue(path, value)
          
 string findFirstValue(<string> path)
           Finds and returns the value of the first node beneath this one that has a path equal to path.
 Composite findLast(path)
          
 Composite findLastNodeWithValue(path, value)
          
 Object findLastValue(path)
          
 AbstractList findNodesWithValue(<string> path, <string> value, <Function> hash)
           Returns a list of all nodes with the given path that have the given value.
 string findValueByIndex(<string> path, <int> index)
           Finds and returns the value of the indexth node beneath this one that has a path equal to path.
 AbstractList findValues(<string> path, <bool> makeHash)
           Finds and returns the values of all the nodes beneath this one that have a path equal to path.
 Composite getChild(index)
          
 int getChildCount()
          
 Iterator getChildIterator()
           Returns an iterator over this node's child list.
 Array getChildren()
          
 string getName()
          
 Composite getParent()
          
 string getPath()
          
 Object getValue()
          
 boolean hasChildren()
          
 Object merge(<Composite> comp, <boolean> returnOldCopy, <boolean> writableInput)
           Updates the model to match what is specified by comp.
 void removeChild(<Composite> child)
           Removes the given Composite from this one.
 void removeChildren(<AbstractList> childList)
           Removes a list of Composites from this one.
 void setValue(newValue)
          
 string toString()
          
<static> Composite fromLoL(<string> name, <string> value, <Array> children)
           Creates and returns a Composite from a list of lists.
<static> Composite fromXML(<DOMNode> xml)
           Creates a Composite tree based on the XML provided.
<static> Array getPathSegments(<string> path)
           Returns an array of path segments given a path.
<static> string toXML(<Composite> node, <Array> roots, <boolean> include)
           Serializes the Composite tree rooted at node to an XML string.

Constructor Detail

Composite

function Composite(<string> name, <Object> value)
Method Detail

addChild

void addChild(<Composite> child)

addChildren

void addChildren(<AbstractList> list)

apply

void apply(<Function> preFunc, <Function> postFunc)

clear

void clear()

clone

Composite clone(<int> depth, <string> newName)

contains

boolean contains(<string> path)

containsNodeWithValue

boolean containsNodeWithValue(<string> path, <string> value)

createPath

Composite createPath(<string> path)

diff

Object diff(<Composite> other)

find

AbstractList find(<string> path, <Function> hash)

findByIndex

Composite findByIndex(<string> path, <int> index)

findFirst

Composite findFirst(<string> path)

findFirstNodeWithValue

Composite findFirstNodeWithValue(path, value)

findFirstValue

string findFirstValue(<string> path)

findLast

Composite findLast(path)

findLastNodeWithValue

Composite findLastNodeWithValue(path, value)

findLastValue

Object findLastValue(path)

findNodesWithValue

AbstractList findNodesWithValue(<string> path, <string> value, <Function> hash)

findValueByIndex

string findValueByIndex(<string> path, <int> index)

findValues

AbstractList findValues(<string> path, <bool> makeHash)

getChild

Composite getChild(index)

getChildCount

int getChildCount()

getChildIterator

Iterator getChildIterator()

getChildren

Array getChildren()

getName

string getName()

getParent

Composite getParent()

getPath

string getPath()

getValue

Object getValue()

hasChildren

boolean hasChildren()

merge

Object merge(<Composite> comp, <boolean> returnOldCopy, <boolean> writableInput)

removeChild

void removeChild(<Composite> child)

removeChildren

void removeChildren(<AbstractList> childList)

setValue

void setValue(newValue)

toString

string toString()

fromLoL

<static> Composite fromLoL(<string> name, <string> value, <Array> children)

fromXML

<static> Composite fromXML(<DOMNode> xml)

getPathSegments

<static> Array getPathSegments(<string> path)

toXML

<static> string toXML(<Composite> node, <Array> roots, <boolean> include)

Sydney

SourceForge.net Logo