OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analysis_server.plugin.analysis.occurrences.occurrences_core; | 5 library analysis_server.plugin.analysis.occurrences.occurrences_core; |
6 | 6 |
7 import 'package:analysis_server/plugin/protocol/protocol.dart' | 7 import 'package:analysis_server/plugin/protocol/protocol.dart' |
8 show Element, Occurrences; | 8 show Element, Occurrences; |
9 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | 9 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; |
10 import 'package:analyzer/src/generated/source.dart' show Source; | 10 import 'package:analyzer/src/generated/source.dart' show Source; |
11 | 11 |
12 /** | 12 /** |
13 * An object that [OccurrencesContributor]s use to record occurrences into. | 13 * An object that [OccurrencesContributor]s use to record occurrences into. |
14 * | 14 * |
15 * Clients are not expected to subtype this class. | 15 * Clients may not extend, implement or mix-in this class. |
16 */ | 16 */ |
17 abstract class OccurrencesCollector { | 17 abstract class OccurrencesCollector { |
18 /** | 18 /** |
19 * Record a new element occurrences. | 19 * Record a new element occurrences. |
20 */ | 20 */ |
21 void addOccurrences(Occurrences occurrences); | 21 void addOccurrences(Occurrences occurrences); |
22 } | 22 } |
23 | 23 |
24 /** | 24 /** |
25 * An object used to produce occurrences. | 25 * An object used to produce occurrences. |
26 * | 26 * |
27 * Clients are expected to subtype this class when implementing plugins. | 27 * Clients may implement this class when implementing plugins. |
28 */ | 28 */ |
29 abstract class OccurrencesContributor { | 29 abstract class OccurrencesContributor { |
30 /** | 30 /** |
31 * Contribute occurrences into the given [collector]. | 31 * Contribute occurrences into the given [collector]. |
32 * The [context] can be used to get analysis results. | 32 * The [context] can be used to get analysis results. |
33 */ | 33 */ |
34 void computeOccurrences( | 34 void computeOccurrences( |
35 OccurrencesCollector collector, AnalysisContext context, Source source); | 35 OccurrencesCollector collector, AnalysisContext context, Source source); |
36 } | 36 } |
OLD | NEW |