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

Unified Diff: sdk/lib/core/iterable.dart

Issue 12094056: Runes, a bi-directional code-point iterator/iterable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make rawIndex return null if there is no current rune. Created 7 years, 10 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: sdk/lib/core/iterable.dart
diff --git a/sdk/lib/core/iterable.dart b/sdk/lib/core/iterable.dart
index fc1a647b179d3217474f2578b147ea0fa92d099b..56e96ef048a5b7a1e99480a160b1cffd0614978c 100644
--- a/sdk/lib/core/iterable.dart
+++ b/sdk/lib/core/iterable.dart
@@ -432,3 +432,16 @@ class _GeneratorIterator<E> implements Iterator<E> {
E get current => _current;
}
+
+/**
+ * An [Iterator] that allows moving backwards as well as forwards.
+ */
+abstract class BiDirectionalIterator<T> extends Iterator<T> {
+ /**
+ * Move back to the previous element.
+ *
+ * Returns true and updates [current] if successful. Returns false
+ * and sets [current] to null if there is no previous element.
+ */
+ bool movePrevious();
+}

Powered by Google App Engine
This is Rietveld 408576698