| OLD | NEW |
| 1 class AbstractNode { | 1 class AbstractNode { |
| 2 | 2 |
| 3 // AbstractNode represents a node in a tree. | 3 // AbstractNode represents a node in a tree. |
| 4 // The AbstractNode protocol is as follows: | 4 // The AbstractNode protocol is as follows: |
| 5 // - When a subclass is changing the parent of a child, it should | 5 // - When a subclass is changing the parent of a child, it should |
| 6 // call either parent.adoptChild(child) or parent.dropChild(child) | 6 // call either parent.adoptChild(child) or parent.dropChild(child) |
| 7 // as appropriate. Subclasses should expose an API for | 7 // as appropriate. Subclasses should expose an API for |
| 8 // manipulating the tree if you want to (e.g. a setter for a | 8 // manipulating the tree if you want to (e.g. a setter for a |
| 9 // 'child' property, or an 'add()' method to manipulate a list). | 9 // 'child' property, or an 'add()' method to manipulate a list). |
| 10 // - You can see the current parent by querying 'parent'. | 10 // - You can see the current parent by querying 'parent'. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 void dropChild(AbstractNode child) { // only for use by subclasses | 73 void dropChild(AbstractNode child) { // only for use by subclasses |
| 74 assert(child != null); | 74 assert(child != null); |
| 75 assert(child._parent == this); | 75 assert(child._parent == this); |
| 76 assert(child.attached == attached); | 76 assert(child.attached == attached); |
| 77 child._parent = null; | 77 child._parent = null; |
| 78 if (attached) | 78 if (attached) |
| 79 child.detach(); | 79 child.detach(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 } | 82 } |
| OLD | NEW |