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

Side by Side Diff: tools/dom/src/WrappedList.dart

Issue 13872007: Refactor removeRange. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebuild dom. 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 unified diff | Download patch | Annotate | Revision Log
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.dom.html; 5 part of dart.dom.html;
6 6
7 /** 7 /**
8 * A list which just wraps another list, for either intercepting list calls or 8 * A list which just wraps another list, for either intercepting list calls or
9 * retyping the list (for example, from List<A> to List<B> where B extends A). 9 * retyping the list (for example, from List<A> to List<B> where B extends A).
10 */ 10 */
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 E removeLast() => _list.removeLast(); 117 E removeLast() => _list.removeLast();
118 118
119 List<E> sublist(int start, [int end]) => _list.sublist(start, end); 119 List<E> sublist(int start, [int end]) => _list.sublist(start, end);
120 120
121 Iterable<E> getRange(int start, int end) => _list.getRange(start, end); 121 Iterable<E> getRange(int start, int end) => _list.getRange(start, end);
122 122
123 void setRange(int start, int end, List<E> from, [int startFrom]) { 123 void setRange(int start, int end, List<E> from, [int startFrom]) {
124 _list.setRange(start, end, from, startFrom); 124 _list.setRange(start, end, from, startFrom);
125 } 125 }
126 126
127 void removeRange(int start, int length) { _list.removeRange(start, length); } 127 void removeRange(int start, int end) { _list.removeRange(start, end); }
128 128
129 void insertRange(int start, int length, [E fill]) { 129 void insertRange(int start, int length, [E fill]) {
130 _list.insertRange(start, length, fill); 130 _list.insertRange(start, length, fill);
131 } 131 }
132 132
133 Map<int, E> asMap() => _list.asMap(); 133 Map<int, E> asMap() => _list.asMap();
134 134
135 String toString() { 135 String toString() {
136 StringBuffer buffer = new StringBuffer('['); 136 StringBuffer buffer = new StringBuffer('[');
137 buffer.writeAll(this, ', '); 137 buffer.writeAll(this, ', ');
138 buffer.write(']'); 138 buffer.write(']');
139 return buffer.toString(); 139 return buffer.toString();
140 } 140 }
141 } 141 }
142 142
143 /** 143 /**
144 * Iterator wrapper for _WrappedList. 144 * Iterator wrapper for _WrappedList.
145 */ 145 */
146 class _WrappedIterator<E> implements Iterator<E> { 146 class _WrappedIterator<E> implements Iterator<E> {
147 Iterator _iterator; 147 Iterator _iterator;
148 148
149 _WrappedIterator(this._iterator); 149 _WrappedIterator(this._iterator);
150 150
151 bool moveNext() { 151 bool moveNext() {
152 return _iterator.moveNext(); 152 return _iterator.moveNext();
153 } 153 }
154 154
155 E get current => _iterator.current; 155 E get current => _iterator.current;
156 } 156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698