Index: pkg/analyzer/lib/task/model.dart |
diff --git a/pkg/analyzer/lib/task/model.dart b/pkg/analyzer/lib/task/model.dart |
index 4da15afe901fa342d1e65b9f2291c1b4a304320d..f05b0e887e9c3c5fc507d02e9d955e05a2d685d8 100644 |
--- a/pkg/analyzer/lib/task/model.dart |
+++ b/pkg/analyzer/lib/task/model.dart |
@@ -34,6 +34,11 @@ typedef Map<String, TaskInput> CreateTaskInputs(AnalysisTarget target); |
typedef TaskInput<E> UnaryFunction<B, E>(B object); |
/** |
+ * TODO |
Brian Wilkerson
2015/04/01 22:13:08
Did you intend to leave this TODO?
|
+ */ |
+typedef TaskInput<E> BinaryFunction<K, V, E>(K key, V value); |
+ |
+/** |
* An [AnalysisTarget] wrapper for an [AnalysisContext]. |
*/ |
class AnalysisContextTarget implements AnalysisTarget { |
@@ -292,7 +297,7 @@ abstract class ListTaskInput<E> extends TaskInput<List<E>> { |
* elements of this input and whose values are the result of passing the |
* corresponding key to the [mapper] function. |
*/ |
- TaskInput<Map<E, dynamic /*V*/ >> toMap( |
+ MapTaskInput<E, dynamic /*V*/ > toMap( |
UnaryFunction<E, dynamic /*<V>*/ > mapper); |
/** |
@@ -300,11 +305,27 @@ abstract class ListTaskInput<E> extends TaskInput<List<E>> { |
* elements of this input and whose values are the [valueResult]'s associated |
* with those elements. |
*/ |
- TaskInput<Map<AnalysisTarget, dynamic /*V*/ >> toMapOf( |
+ MapTaskInput<AnalysisTarget, dynamic /*V*/ > toMapOf( |
ResultDescriptor /*<V>*/ valueResult); |
} |
/** |
+ * A description of an input with a [Map] based values. TODO |
+ * |
+ * Clients are not expected to subtype this class. |
+ */ |
+abstract class MapTaskInput<K, V> extends TaskInput<Map<K, V>> { |
+ /** |
+ * [V] must be a [List]. |
+ * Return a task input that can be used to compute a list whose elements are |
+ * the result of passing keys [K] and the corresponding elements of [V] to |
+ * the [mapper] function. |
+ */ |
+ TaskInput<List /*<E>*/ > toFlattenList( |
+ BinaryFunction<K, dynamic /*element of V*/, dynamic /*<E>*/ > mapper); |
+} |
+ |
+/** |
* A description of an analysis result that can be computed by an [AnalysisTask]. |
* |
* Clients are not expected to subtype this class. |