Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: pkg/analyzer/lib/src/task/model.dart

Issue 1005693007: Add toMap / toMapOf / toList (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/task/model.dart
diff --git a/pkg/analyzer/lib/src/task/model.dart b/pkg/analyzer/lib/src/task/model.dart
index 787dac47ec7426bb62fa9daa20a8f42813afa151..66ffb9ea93c350710d1c0640e52bfd3e52710d44 100644
--- a/pkg/analyzer/lib/src/task/model.dart
+++ b/pkg/analyzer/lib/src/task/model.dart
@@ -32,6 +32,25 @@ class CompositeResultDescriptorImpl<V> extends ResultDescriptorImpl<V>
}
/**
+ * A concrete implementation of a [ListResultDescriptor].
+ */
+class ListResultDescriptorImpl<E> extends ResultDescriptorImpl<List<E>>
+ implements ListResultDescriptor<E> {
+ /**
+ * Initialize a newly created analysis result to have the given [name] and
+ * [defaultValue]. If a composite result is specified, then this result will
+ * contribute to it.
+ */
+ ListResultDescriptorImpl(String name, List<E> defaultValue,
+ {CompositeResultDescriptor contributesTo})
+ : super(name, defaultValue, contributesTo: contributesTo);
+
+ @override
+ ListTaskInput<E> of(AnalysisTarget target) =>
+ new ListTaskInputImpl<E>(target, this);
+}
+
+/**
* A concrete implementation of a [ResultDescriptor].
*/
class ResultDescriptorImpl<V> implements ResultDescriptor<V> {
@@ -58,7 +77,7 @@ class ResultDescriptorImpl<V> implements ResultDescriptor<V> {
}
@override
- TaskInput<V> inputFor(AnalysisTarget target) =>
+ TaskInput<V> of(AnalysisTarget target) =>
new SimpleTaskInput<V>(target, this);
@override

Powered by Google App Engine
This is Rietveld 408576698