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 test.index.store_memory_node_manager; | 5 library engine.src.index.store_memory_node_manager; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'package:analysis_server/src/index/store/codec.dart'; | |
11 import 'package:analysis_server/src/index/store/split_store.dart'; | |
12 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
| 11 import 'package:analyzer/src/index/store/codec.dart'; |
| 12 import 'package:analyzer/src/index/store/split_store.dart'; |
13 | 13 |
14 | 14 |
15 class MemoryNodeManager implements NodeManager { | 15 class MemoryNodeManager implements NodeManager { |
| 16 StringCodec _stringCodec = new StringCodec(); |
16 ContextCodec _contextCodec = new ContextCodec(); | 17 ContextCodec _contextCodec = new ContextCodec(); |
17 ElementCodec _elementCodec; | 18 ElementCodec _elementCodec; |
| 19 RelationshipCodec _relationshipCodec; |
| 20 |
18 int _locationCount = 0; | 21 int _locationCount = 0; |
19 final Map<String, int> _nodeLocationCounts = new HashMap<String, int>(); | 22 final Map<String, int> _nodeLocationCounts = new HashMap<String, int>(); |
20 final Map<String, IndexNode> _nodes = new HashMap<String, IndexNode>(); | 23 final Map<String, IndexNode> _nodes = new HashMap<String, IndexNode>(); |
21 RelationshipCodec _relationshipCodec; | |
22 StringCodec _stringCodec = new StringCodec(); | |
23 | 24 |
24 MemoryNodeManager() { | 25 MemoryNodeManager() { |
25 _elementCodec = new ElementCodec(_stringCodec); | 26 _elementCodec = new ElementCodec(_stringCodec); |
26 _relationshipCodec = new RelationshipCodec(_stringCodec); | 27 _relationshipCodec = new RelationshipCodec(_stringCodec); |
27 } | 28 } |
28 | 29 |
29 @override | 30 @override |
30 ContextCodec get contextCodec { | 31 ContextCodec get contextCodec { |
31 return _contextCodec; | 32 return _contextCodec; |
32 } | 33 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 88 } |
88 // remember the node | 89 // remember the node |
89 _nodes[name] = node; | 90 _nodes[name] = node; |
90 } | 91 } |
91 | 92 |
92 @override | 93 @override |
93 void removeNode(String name) { | 94 void removeNode(String name) { |
94 _nodes.remove(name); | 95 _nodes.remove(name); |
95 } | 96 } |
96 } | 97 } |
OLD | NEW |