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

Side by Side Diff: sdk/lib/collection/linked_list.dart

Issue 1025573005: Move implementation from IterableBase to Iterable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove extra "static" on helper functions. Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/collection/iterable.dart ('k') | sdk/lib/collection/maps.dart » ('j') | 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 part of dart.collection; 5 part of dart.collection;
6 6
7 7
8 /** 8 /**
9 * A specialized double-linked list of elements that extends [LinkedListEntry]. 9 * A specialized double-linked list of elements that extends [LinkedListEntry].
10 * 10 *
(...skipping 11 matching lines...) Expand all
22 * 22 *
23 * In return, each element knows its own place in the linked list, as well as 23 * In return, each element knows its own place in the linked list, as well as
24 * which list it is in. This allows constant time [LinkedListEntry.addAfter], 24 * which list it is in. This allows constant time [LinkedListEntry.addAfter],
25 * [LinkedListEntry.addBefore] and [LinkedListEntry.unlink] operations 25 * [LinkedListEntry.addBefore] and [LinkedListEntry.unlink] operations
26 * when all you have is the element. 26 * when all you have is the element.
27 * 27 *
28 * A `LinkedList` also allows constant time adding and removing at either end, 28 * A `LinkedList` also allows constant time adding and removing at either end,
29 * and a constant time length getter. 29 * and a constant time length getter.
30 */ 30 */
31 class LinkedList<E extends LinkedListEntry<E>> 31 class LinkedList<E extends LinkedListEntry<E>>
32 extends IterableBase<E> 32 extends Iterable<E>
33 implements _LinkedListLink { 33 implements _LinkedListLink {
34 34
35 int _modificationCount = 0; 35 int _modificationCount = 0;
36 int _length = 0; 36 int _length = 0;
37 _LinkedListLink _next; 37 _LinkedListLink _next;
38 _LinkedListLink _previous; 38 _LinkedListLink _previous;
39 39
40 /** 40 /**
41 * Construct a new empty linked list. 41 * Construct a new empty linked list.
42 */ 42 */
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 /** 274 /**
275 * Insert an element before this element in this element's linked list. 275 * Insert an element before this element in this element's linked list.
276 * 276 *
277 * This entry must be in a linked list when this method is called. 277 * This entry must be in a linked list when this method is called.
278 * The [entry] must not be in a linked list. 278 * The [entry] must not be in a linked list.
279 */ 279 */
280 void insertBefore(E entry) { 280 void insertBefore(E entry) {
281 _list._insertAfter(_previous, entry); 281 _list._insertAfter(_previous, entry);
282 } 282 }
283 } 283 }
OLDNEW
« no previous file with comments | « sdk/lib/collection/iterable.dart ('k') | sdk/lib/collection/maps.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698