34 | | The model will be constructed by nodes that can either have value or children but not both. Once created the value of the node could not be changed. Every value node will hold the value of specific property that could be accessed only by the right key. The children nodes will hold maps of names and corresponding nodes so basically it is an immutable tree structure.[[BR]] [[BR]] |
35 | | The path in this tree structure will be going through nodes that correspond to parts of the keys id and getting a keys value is just finding the right value node and getting its value. For example if you are looking for the value of the border color of page A you should look in the tree nodes as follows : root(“”)->children->PageA->border->color. All nodes except the last one are children nodes and the last node will be value node with the ImmColor as its value. [[BR]] [[BR]] |
36 | | Since all nodes have only final values the modifications on it will return new instances of the model with all modifications applied. Furthermore it will be too heavy to apply every change on its own and copy the model every time so the modify method will take as argument a Map of keys to be changed and their new values.[[BR]] [[BR]] |
| 34 | The model will be constructed by immutable nodes that can either have value or children, but not both. Every 'value' node will hold the value of specific property that can be accessed by specific key. The 'children' nodes will hold maps of names and corresponding nodes so basically it is an immutable tree structure.[[BR]] [[BR]] |
| 35 | The path in this tree structure will be going through nodes that correspond to parts of the keys id and getting a keys value is just finding the right value node and getting its value. For example if you are looking for the value of the border color of 'page A' you should look in the tree nodes as follows : root(“”)->children->PageA->border->color. All nodes except the last one are children nodes and the last node will be value node with the ImmColor as its value. [[BR]] [[BR]] |
| 36 | Since all nodes have only final values the modifications on this model will return new instances of the model with all modifications applied. Furthermore it will be too heavy to apply every change on its own and copy the model for every alteration so the modify method should take as argument a Map of keys to be changed and their new values.[[BR]] [[BR]] |