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

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

Issue 12383073: Add List.insert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use insertBefore and add is-check. Created 7 years, 9 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 void addLast(E value) { _list.add(value); } 102 void addLast(E value) { _list.add(value); }
103 103
104 Iterable<E> get reversed => _list.reversed; 104 Iterable<E> get reversed => _list.reversed;
105 105
106 void sort([int compare(E a, E b)]) { _list.sort(compare); } 106 void sort([int compare(E a, E b)]) { _list.sort(compare); }
107 107
108 int indexOf(E element, [int start = 0]) => _list.indexOf(element, start); 108 int indexOf(E element, [int start = 0]) => _list.indexOf(element, start);
109 109
110 int lastIndexOf(E element, [int start]) => _list.lastIndexOf(element, start); 110 int lastIndexOf(E element, [int start]) => _list.lastIndexOf(element, start);
111 111
112 void insert(int index, E element) => _list.insert(index, element);
113
112 E removeAt(int index) => _list.removeAt(index); 114 E removeAt(int index) => _list.removeAt(index);
113 115
114 E removeLast() => _list.removeLast(); 116 E removeLast() => _list.removeLast();
115 117
116 List<E> getRange(int start, int length) => _list.getRange(start, length); 118 List<E> getRange(int start, int length) => _list.getRange(start, length);
117 119
118 void setRange(int start, int length, List<E> from, [int startFrom]) { 120 void setRange(int start, int length, List<E> from, [int startFrom]) {
119 _list.setRange(start, length, from, startFrom); 121 _list.setRange(start, length, from, startFrom);
120 } 122 }
121 123
(...skipping 13 matching lines...) Expand all
135 Iterator _iterator; 137 Iterator _iterator;
136 138
137 _WrappedIterator(this._iterator); 139 _WrappedIterator(this._iterator);
138 140
139 bool moveNext() { 141 bool moveNext() {
140 return _iterator.moveNext(); 142 return _iterator.moveNext();
141 } 143 }
142 144
143 E get current => _iterator.current; 145 E get current => _iterator.current;
144 } 146 }
OLDNEW
« no previous file with comments | « tests/corelib/list_insert_test.dart ('k') | tools/dom/templates/html/impl/impl_Element.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698