| 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 analyzer.task.model; | 5 library analyzer.task.model; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:developer'; | 8 import 'dart:developer'; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 int measure(T object); | 450 int measure(T object); |
| 451 } | 451 } |
| 452 | 452 |
| 453 /** | 453 /** |
| 454 * A description of an analysis result that can be computed by an [AnalysisTask]
. | 454 * A description of an analysis result that can be computed by an [AnalysisTask]
. |
| 455 * | 455 * |
| 456 * Clients may not extend, implement or mix-in this class. | 456 * Clients may not extend, implement or mix-in this class. |
| 457 */ | 457 */ |
| 458 abstract class ResultDescriptor<V> { | 458 abstract class ResultDescriptor<V> { |
| 459 /** | 459 /** |
| 460 * A comparator that can be used to sort result descriptors by their name. |
| 461 */ |
| 462 static final Comparator<ResultDescriptor> SORT_BY_NAME = |
| 463 (ResultDescriptor first, ResultDescriptor second) => |
| 464 first.name.compareTo(second.name); |
| 465 |
| 466 /** |
| 460 * Initialize a newly created analysis result to have the given [name] and | 467 * Initialize a newly created analysis result to have the given [name] and |
| 461 * [defaultValue]. | 468 * [defaultValue]. |
| 462 * | 469 * |
| 463 * The given [cachingPolicy] is used to limit the total size of results | 470 * The given [cachingPolicy] is used to limit the total size of results |
| 464 * described by this descriptor. If no policy is specified, the results are | 471 * described by this descriptor. If no policy is specified, the results are |
| 465 * never evicted from the cache, and removed only when they are invalidated. | 472 * never evicted from the cache, and removed only when they are invalidated. |
| 466 */ | 473 */ |
| 467 factory ResultDescriptor(String name, V defaultValue, | 474 factory ResultDescriptor(String name, V defaultValue, |
| 468 {ResultCachingPolicy<V> cachingPolicy}) = ResultDescriptorImpl<V>; | 475 {ResultCachingPolicy<V> cachingPolicy}) = ResultDescriptorImpl<V>; |
| 469 | 476 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 /** | 771 /** |
| 765 * A work should be done, but without any special urgency. | 772 * A work should be done, but without any special urgency. |
| 766 */ | 773 */ |
| 767 NORMAL, | 774 NORMAL, |
| 768 | 775 |
| 769 /** | 776 /** |
| 770 * Nothing to do. | 777 * Nothing to do. |
| 771 */ | 778 */ |
| 772 NONE | 779 NONE |
| 773 } | 780 } |
| OLD | NEW |