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

Side by Side Diff: pkg/collection_helpers/lib/wrappers.dart

Issue 78093002: Add queue.removeWhere/retainWhere to wrappers.dart as well. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Delegating wrappers for [Iterable], [List], [Set], [Queue] and [Map]. 6 * Delegating wrappers for [Iterable], [List], [Set], [Queue] and [Map].
7 * 7 *
8 * Also adds unmodifiable views for `Set` and `Map`, and a fixed length 8 * Also adds unmodifiable views for `Set` and `Map`, and a fixed length
9 * view for `List`. The unmodifable list view from `dart:collection` is exported 9 * view for `List`. The unmodifable list view from `dart:collection` is exported
10 * as well, just for completeness. 10 * as well, just for completeness.
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 void addLast(E value) { 269 void addLast(E value) {
270 _baseQueue.addLast(value); 270 _baseQueue.addLast(value);
271 } 271 }
272 272
273 void clear() { 273 void clear() {
274 _baseQueue.clear(); 274 _baseQueue.clear();
275 } 275 }
276 276
277 bool remove(Object object) => _baseQueue.remove(object); 277 bool remove(Object object) => _baseQueue.remove(object);
278 278
279 void removeWhere(bool test(E element)) { _baseQueue.removeWhere(test); }
280
281 void retainWhere(bool test(E element)) { _baseQueue.retainWhere(test); }
282
279 E removeFirst() => _baseQueue.removeFirst(); 283 E removeFirst() => _baseQueue.removeFirst();
280 284
281 E removeLast() => _baseQueue.removeLast(); 285 E removeLast() => _baseQueue.removeLast();
282 } 286 }
283 287
284 /** 288 /**
285 * Creates a [Map] that delegates all operations to a base map. 289 * Creates a [Map] that delegates all operations to a base map.
286 * 290 *
287 * This class can be used hide non-`Map` methods of an object that extends 291 * This class can be used hide non-`Map` methods of an object that extends
288 * `Map`, or it can be extended to add extra functionality on top of an existing 292 * `Map`, or it can be extended to add extra functionality on top of an existing
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 Iterable<K> get keys => _base.keys; 325 Iterable<K> get keys => _base.keys;
322 326
323 int get length => _base.length; 327 int get length => _base.length;
324 328
325 V putIfAbsent(K key, V ifAbsent()) => _base.putIfAbsent(key, ifAbsent); 329 V putIfAbsent(K key, V ifAbsent()) => _base.putIfAbsent(key, ifAbsent);
326 330
327 V remove(Object key) => _base.remove(key); 331 V remove(Object key) => _base.remove(key);
328 332
329 Iterable<V> get values => _base.values; 333 Iterable<V> get values => _base.values;
330 } 334 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698