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

Unified Diff: pkg/compiler/lib/src/util/link.dart

Issue 1302333006: Support metadata on patches. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Remove partial renaming Created 5 years, 3 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/compiler/lib/src/util/link.dart
diff --git a/pkg/compiler/lib/src/util/link.dart b/pkg/compiler/lib/src/util/link.dart
index d09639cae2764fae3eef4ccd6ac165182d8bb5b2..3a9c133982b050f4b78b0dcab15276f39a8ff26e 100644
--- a/pkg/compiler/lib/src/util/link.dart
+++ b/pkg/compiler/lib/src/util/link.dart
@@ -122,19 +122,31 @@ class Link<T> {
Link copyWithout(e) => this;
}
+/// Builder object for creating linked lists using [Link] or fixed-length [List]
+/// objects.
abstract class LinkBuilder<T> {
factory LinkBuilder() = LinkBuilderImplementation;
- /**
- * Prepends all elements added to the builder to [tail]. The resulting list is
- * returned and the builder is cleared.
- */
+ /// Prepends all elements added to the builder to [tail]. The resulting list
+ /// is returned and the builder is cleared.
Link<T> toLink([Link<T> tail = const Link()]);
+ /// Creates a new fixed length containing all added elements. The
+ /// resulting list is returned and the builder is cleared.
List<T> toList();
+ /// Adds the element [t] to the end of the list being built.
Link<T> addLast(T t);
+ /// Returns the first element in the list being built.
+ T get first;
+
+ /// Returns the number of elements in the list being built.
final int length;
+
+ /// Returns `true` if the list being built is empty.
final bool isEmpty;
+
+ /// Removes all added elements and resets the builder.
+ void clear();
}

Powered by Google App Engine
This is Rietveld 408576698