Chromium Code Reviews| Index: pkg/analyzer/lib/src/task/inputs.dart |
| diff --git a/pkg/analyzer/lib/src/task/inputs.dart b/pkg/analyzer/lib/src/task/inputs.dart |
| index 425869ff462b91d704d8f62b21566db864be0ff8..d06a694ece89c6a60e65c29739ae9d3cc9b97d8f 100644 |
| --- a/pkg/analyzer/lib/src/task/inputs.dart |
| +++ b/pkg/analyzer/lib/src/task/inputs.dart |
| @@ -16,6 +16,35 @@ import 'package:analyzer/task/model.dart'; |
| typedef TaskInput<E> GenerateTaskInputs<B, E>(B object); |
| /** |
| + * An input to an [AnalysisTask] that is computed by accessing a single result |
| + * defined on a single target. |
| + */ |
| +class ListTaskInputImpl<E> extends SimpleTaskInput<List<E>> |
| + implements ListTaskInput<E> { |
| + /** |
| + * Initialize a newly created task input that computes the input by accessing |
| + * the given [result] associated with the given [target]. |
| + */ |
| + ListTaskInputImpl(AnalysisTarget target, ResultDescriptor<List<E>> result) |
| + : super(target, result); |
| + |
| + @override |
| + TaskInput<List> toList(MapTaskInput mapper) { |
| + return new ListToListTaskInput(this, mapper); |
| + } |
| + |
| + @override |
| + TaskInput<Map<E, Object>> toMap(GenerateTaskInputs mapper) { |
|
Brian Wilkerson
2015/03/24 15:07:10
The overridden method has a parameter type of MapT
scheglov
2015/03/24 17:16:39
Done.
|
| + return new ListToMapTaskInput(this, mapper); |
| + } |
| + |
| + @override |
| + TaskInput<Map> toMapOf(ResultDescriptor valueResult) { |
| + return toMap(valueResult.of); |
| + } |
| +} |
| + |
| +/** |
| * An input to an [AnalysisTask] that is computed by the following steps. First |
| * another (base) task input is used to compute a [List]-valued result. An input |
| * generator function is then used to map each element of that list to a task |