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

Unified Diff: sdk/lib/collection/queue.dart

Issue 14173003: Remove Collection, Collections and clean up List/Set/Queue implementations of retain/remove. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
« no previous file with comments | « sdk/lib/collection/list.dart ('k') | sdk/lib/core/collection.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection/queue.dart
diff --git a/sdk/lib/collection/queue.dart b/sdk/lib/collection/queue.dart
index c5d5d367ea67d876ce5f4aed0af2a3eb1d9e3c8e..85947d096b6b06304acac5e196f5a6071d2ee815 100644
--- a/sdk/lib/collection/queue.dart
+++ b/sdk/lib/collection/queue.dart
@@ -9,7 +9,7 @@ part of dart.collection;
* can iterate over the elements of a queue through [forEach] or with
* an [Iterator].
*/
-abstract class Queue<E> implements Collection<E> {
+abstract class Queue<E> implements Iterable<E> {
/**
* Creates a queue.
@@ -160,7 +160,7 @@ class _DoubleLinkedQueueEntrySentinel<E> extends DoubleLinkedQueueEntry<E> {
*
* Can do [removeAll] and [retainAll] in linear time.
*/
-class DoubleLinkedQueue<E> extends Collection<E> implements Queue<E> {
+class DoubleLinkedQueue<E> extends Iterable<E> implements Queue<E> {
_DoubleLinkedQueueEntrySentinel<E> _sentinel;
int _elementCount = 0;
@@ -310,7 +310,7 @@ class DoubleLinkedQueue<E> extends Collection<E> implements Queue<E> {
}
String toString() {
- return Collections.collectionToString(this);
+ return ToString.iterableToString(this);
}
}
@@ -351,10 +351,10 @@ class _DoubleLinkedQueueIterator<E> implements Iterator<E> {
*
* The structure is efficient for any queue or stack usage.
*
- * Collection operations like [removeAll] and [removeWhere] are very
+ * Operations like [removeAll] and [removeWhere] are very
* inefficient. If those are needed, use a [DoubleLinkedQueue] instead.
*/
-class ListQueue<E> extends Collection<E> implements Queue<E>{
+class ListQueue<E> extends Iterable<E> implements Queue<E>{
static const int _INITIAL_CAPACITY = 8;
List<E> _table;
int _head;
@@ -490,14 +490,6 @@ class ListQueue<E> extends Collection<E> implements Queue<E>{
_modificationCount++;
}
- void removeAll(Iterable objectsToRemove) {
- IterableMixinWorkaround.removeAllList(this, objectsToRemove);
- }
-
- void retainAll(Iterable objectsToRetain) {
- IterableMixinWorkaround.retainAll(this, objectsToRetain);
- }
-
void _filterWhere(bool test(E element), bool removeMatching) {
int index = _head;
int modificationCount = _modificationCount;
@@ -546,7 +538,7 @@ class ListQueue<E> extends Collection<E> implements Queue<E>{
}
String toString() {
- return Collections.collectionToString(this);
+ return ToString.iterableToString(this);
}
// Queue interface.
« no previous file with comments | « sdk/lib/collection/list.dart ('k') | sdk/lib/core/collection.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698