|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--JourneySat.Node
This class implements the node of a tree.
Every node has a link to its parent, previous sibling, next sibling,
first child and last child.
Defined in travel.js
See:
| Field Summary | |
JourneySat.Node |
firstChild
Reference to the first child of this node |
JourneySat.Node |
lastChild
Reference to the last child of this node |
Object |
nextSibling
Reference to the sibling of this node which is one position closer to parent.lastChild in the siblings list |
JourneySat.Node |
parent
Reference to the parent of this node |
JourneySat.Node |
prevSibling
Reference to the sibling of this node which is one position closer to parent.firstChild in the siblings list |
Object |
value
The value of this node. |
| Constructor Summary | |
JourneySat.Node
()
|
|
| Method Summary | |
Object
|
addChild(value)
Creates a new node and adds it to the tree as a child of this node. |
Object
|
insertSibling(value)
Creates a new node and adds it to the tree as a sibling of this node. |
void
|
remove()
Removes a node from the tree. |
void
|
swapNextSibling()
Moves this node one position closer to parent.lastChild in its siblings list. |
void
|
swapPrevSibling()
Moves this node one position closer to parent.firstChild in its siblings list. |
String
|
toString()
Returns a string representation of this node, in the format this.value = |
| Field Detail |
JourneySat.Node firstChild
JourneySat.Node lastChild
Object nextSibling
JourneySat.Node parent
JourneySat.Node prevSibling
Object value
| Constructor Detail |
JourneySat.Node()
| Method Detail |
Object addChild(value)
value - The value of the new node. It must implement a toString() method
Object insertSibling(value)
value - The value of the new node It must implement a toString() method
void remove()
void swapNextSibling()
void swapPrevSibling()
String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||