| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library index.b_plus_tree; | 5 library index.b_plus_tree; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 IndexNodeData<K, int> readIndex(int id) { | 225 IndexNodeData<K, int> readIndex(int id) { |
| 226 return _indexDataMap[id]; | 226 return _indexDataMap[id]; |
| 227 } | 227 } |
| 228 | 228 |
| 229 @override | 229 @override |
| 230 LeafNodeData<K, V> readLeaf(int id) { | 230 LeafNodeData<K, V> readLeaf(int id) { |
| 231 return _leafDataMap[id]; | 231 return _leafDataMap[id]; |
| 232 } | 232 } |
| 233 | 233 |
| 234 @override | 234 @override |
| 235 void writeIndex(int id, IndexNodeData<K, V> data) { | 235 void writeIndex(int id, IndexNodeData<K, int> data) { |
| 236 _indexDataMap[id] = data; | 236 _indexDataMap[id] = data; |
| 237 } | 237 } |
| 238 | 238 |
| 239 @override | 239 @override |
| 240 void writeLeaf(int id, LeafNodeData<K, V> data) { | 240 void writeLeaf(int id, LeafNodeData<K, V> data) { |
| 241 _leafDataMap[id] = data; | 241 _leafDataMap[id] = data; |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 | 244 |
| 245 | 245 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 273 IndexNodeData<K, N> readIndex(N id); | 273 IndexNodeData<K, N> readIndex(N id); |
| 274 | 274 |
| 275 /** | 275 /** |
| 276 * Reads information about the leaf node with the given identifier. | 276 * Reads information about the leaf node with the given identifier. |
| 277 */ | 277 */ |
| 278 LeafNodeData<K, V> readLeaf(N id); | 278 LeafNodeData<K, V> readLeaf(N id); |
| 279 | 279 |
| 280 /** | 280 /** |
| 281 * Writes information about the index node with the given identifier. | 281 * Writes information about the index node with the given identifier. |
| 282 */ | 282 */ |
| 283 void writeIndex(N id, IndexNodeData<K, V> data); | 283 void writeIndex(N id, IndexNodeData<K, N> data); |
| 284 | 284 |
| 285 /** | 285 /** |
| 286 * Writes information about the leaf node with the given identifier. | 286 * Writes information about the leaf node with the given identifier. |
| 287 */ | 287 */ |
| 288 void writeLeaf(N id, LeafNodeData<K, V> data); | 288 void writeLeaf(N id, LeafNodeData<K, V> data); |
| 289 } | 289 } |
| 290 | 290 |
| 291 | 291 |
| 292 /** | 292 /** |
| 293 * An index node with keys and children references. | 293 * An index node with keys and children references. |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 | 733 |
| 734 /** | 734 /** |
| 735 * A container with information about split during insert. | 735 * A container with information about split during insert. |
| 736 */ | 736 */ |
| 737 class _Split<K, N> { | 737 class _Split<K, N> { |
| 738 final K key; | 738 final K key; |
| 739 final N left; | 739 final N left; |
| 740 final N right; | 740 final N right; |
| 741 _Split(this.key, this.left, this.right); | 741 _Split(this.key, this.left, this.right); |
| 742 } | 742 } |
| OLD | NEW |