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

Side by Side Diff: corelib/src/implementation/queue.dart

Issue 8549033: Update comments in core lib showing proper factory syntax. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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 | « corelib/src/implementation/linked_hash_map.dart ('k') | corelib/src/map.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 6 /**
7 * An entry in a doubly linked list. It contains a pointer to the next 7 * An entry in a doubly linked list. It contains a pointer to the next
8 * entry, the previous entry, and the boxed element. 8 * entry, the previous entry, and the boxed element.
9 */ 9 */
10 class DoubleLinkedQueueEntry<E> { 10 class DoubleLinkedQueueEntry<E> {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 * Implementation of a double linked list that box list elements into 95 * Implementation of a double linked list that box list elements into
96 * DoubleLinkedQueueEntry objects. 96 * DoubleLinkedQueueEntry objects.
97 */ 97 */
98 class DoubleLinkedQueue<E> implements Queue<E> { 98 class DoubleLinkedQueue<E> implements Queue<E> {
99 _DoubleLinkedQueueEntrySentinel<E> _sentinel; 99 _DoubleLinkedQueueEntrySentinel<E> _sentinel;
100 100
101 DoubleLinkedQueue() { 101 DoubleLinkedQueue() {
102 _sentinel = new _DoubleLinkedQueueEntrySentinel<E>(); 102 _sentinel = new _DoubleLinkedQueueEntrySentinel<E>();
103 } 103 }
104 104
105 // See bug 5257789. 105 // See issue 417. Works in the vm, fails in dartc and frog.
106 factory DoubleLinkedQueue/* <E> */.from(Iterable/* <E> */ other) { 106 factory DoubleLinkedQueue/*<E>*/.from(Iterable/*<E>*/ other) {
107 Queue/* <E> */ list = new DoubleLinkedQueue(); 107 Queue/*<E>*/ list = new DoubleLinkedQueue();
108 for (final e in other) { 108 for (final e in other) {
109 list.addLast(e); 109 list.addLast(e);
110 } 110 }
111 return list; 111 return list;
112 } 112 }
113 113
114 void addLast(E value) { 114 void addLast(E value) {
115 _sentinel.prepend(value); 115 _sentinel.prepend(value);
116 } 116 }
117 117
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 } 235 }
236 236
237 E next() { 237 E next() {
238 if (!hasNext()) { 238 if (!hasNext()) {
239 throw const NoMoreElementsException(); 239 throw const NoMoreElementsException();
240 } 240 }
241 _currentEntry = _currentEntry._next; 241 _currentEntry = _currentEntry._next;
242 return _currentEntry.element; 242 return _currentEntry.element;
243 } 243 }
244 } 244 }
OLDNEW
« no previous file with comments | « corelib/src/implementation/linked_hash_map.dart ('k') | corelib/src/map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698