| 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 | 8 |
| 9 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask; | 9 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask; |
| 10 import 'package:analyzer/src/generated/java_engine.dart'; | 10 import 'package:analyzer/src/generated/java_engine.dart'; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 * The target for which result values are being produced. | 96 * The target for which result values are being produced. |
| 97 */ | 97 */ |
| 98 final AnalysisTarget target; | 98 final AnalysisTarget target; |
| 99 | 99 |
| 100 /** | 100 /** |
| 101 * A table mapping input names to input values. | 101 * A table mapping input names to input values. |
| 102 */ | 102 */ |
| 103 Map<String, dynamic> inputs; | 103 Map<String, dynamic> inputs; |
| 104 | 104 |
| 105 /** | 105 /** |
| 106 * The optional data that the task associated with [target] last time. |
| 107 * This data may help to compute outputs more efficiently. |
| 108 */ |
| 109 dynamic inputMemento; |
| 110 |
| 111 /** |
| 106 * A table mapping result descriptors whose values are produced by this task | 112 * A table mapping result descriptors whose values are produced by this task |
| 107 * to the values that were produced. | 113 * to the values that were produced. |
| 108 */ | 114 */ |
| 109 Map<ResultDescriptor, dynamic> outputs = | 115 Map<ResultDescriptor, dynamic> outputs = |
| 110 new HashMap<ResultDescriptor, dynamic>(); | 116 new HashMap<ResultDescriptor, dynamic>(); |
| 111 | 117 |
| 112 /** | 118 /** |
| 119 * An optional data that the task wants to associate with [target]. |
| 120 * This data may help later to compute outputs more efficiently. |
| 121 */ |
| 122 dynamic outputMemento; |
| 123 |
| 124 /** |
| 113 * The exception that was thrown while performing this task, or `null` if the | 125 * The exception that was thrown while performing this task, or `null` if the |
| 114 * task completed successfully. | 126 * task completed successfully. |
| 115 */ | 127 */ |
| 116 CaughtException caughtException; | 128 CaughtException caughtException; |
| 117 | 129 |
| 118 /** | 130 /** |
| 119 * Initialize a newly created task to perform analysis within the given | 131 * Initialize a newly created task to perform analysis within the given |
| 120 * [context] in order to produce results for the given [target]. | 132 * [context] in order to produce results for the given [target]. |
| 121 */ | 133 */ |
| 122 AnalysisTask(this.context, this.target); | 134 AnalysisTask(this.context, this.target); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 /** | 394 /** |
| 383 * Return a list of the analysis results that will be computed by this task. | 395 * Return a list of the analysis results that will be computed by this task. |
| 384 */ | 396 */ |
| 385 List<ResultDescriptor> get results; | 397 List<ResultDescriptor> get results; |
| 386 | 398 |
| 387 /** | 399 /** |
| 388 * Create and return a task that is described by this descriptor that can be | 400 * Create and return a task that is described by this descriptor that can be |
| 389 * used to compute results based on the given [inputs]. | 401 * used to compute results based on the given [inputs]. |
| 390 */ | 402 */ |
| 391 AnalysisTask createTask(AnalysisContext context, AnalysisTarget target, | 403 AnalysisTask createTask(AnalysisContext context, AnalysisTarget target, |
| 392 Map<String, dynamic> inputs); | 404 Map<String, dynamic> inputs, dynamic inputMemento); |
| 393 } | 405 } |
| 394 | 406 |
| 395 /** | 407 /** |
| 396 * A description of an input to an [AnalysisTask] that can be used to compute | 408 * A description of an input to an [AnalysisTask] that can be used to compute |
| 397 * that input. | 409 * that input. |
| 398 * | 410 * |
| 399 * Clients are not expected to subtype this class. | 411 * Clients are not expected to subtype this class. |
| 400 */ | 412 */ |
| 401 abstract class TaskInput<V> { | 413 abstract class TaskInput<V> { |
| 402 /** | 414 /** |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 * be computed, or `false` if the inputs have been computed. | 468 * be computed, or `false` if the inputs have been computed. |
| 457 * | 469 * |
| 458 * It is safe to invoke [moveNext] after it has returned `false`. In this case | 470 * It is safe to invoke [moveNext] after it has returned `false`. In this case |
| 459 * [moveNext] has no effect and will again return `false`. | 471 * [moveNext] has no effect and will again return `false`. |
| 460 * | 472 * |
| 461 * Throws a [StateError] if the value of the current result has not been | 473 * Throws a [StateError] if the value of the current result has not been |
| 462 * provided using [currentValue]. | 474 * provided using [currentValue]. |
| 463 */ | 475 */ |
| 464 bool moveNext(); | 476 bool moveNext(); |
| 465 } | 477 } |
| OLD | NEW |