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

Side by Side Diff: lib/core/list.dart

Issue 10970009: Add list.removeAt method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated doc-comment. Created 8 years, 3 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 | « lib/compiler/implementation/lib/interceptors.dart ('k') | runtime/lib/array.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 * A [List] is an indexable collection with a length. It can be of 6 * A [List] is an indexable collection with a length. It can be of
7 * fixed size or extendable. 7 * fixed size or extendable.
8 */ 8 */
9 interface List<E> extends Collection<E> default ListImplementation<E> { 9 interface List<E> extends Collection<E> default ListImplementation<E> {
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 int lastIndexOf(E element, [int start]); 89 int lastIndexOf(E element, [int start]);
90 90
91 /** 91 /**
92 * Removes all elements in the list. The length of the list 92 * Removes all elements in the list. The length of the list
93 * becomes zero. Throws an [UnsupportedOperationException] if 93 * becomes zero. Throws an [UnsupportedOperationException] if
94 * the list is not extendable. 94 * the list is not extendable.
95 */ 95 */
96 void clear(); 96 void clear();
97 97
98 /** 98 /**
99 * Removes the element at position[index] from the list.
100 *
101 * This reduces the length of the list by one and moves all later elements
102 * down by one position.
103 * Returns the removed element.
104 * Throws a [IllegalArgumentException] if [index] is not an integer, and
105 * [IndexOutOfRangeException] if the [index] does not point inside the list.
106 *
107 * Throws a [UnsupportedOperationException] if the list, or the length of
108 * the list, cannot be changed.
109 */
110 E removeAt(int index);
111
112 /**
99 * Pops and returns the last element of the list. 113 * Pops and returns the last element of the list.
100 * Throws a [UnsupportedOperationException] if the length of the 114 * Throws a [UnsupportedOperationException] if the length of the
101 * list cannot be changed. 115 * list cannot be changed.
116 *
102 */ 117 */
103 E removeLast(); 118 E removeLast();
104 119
105 /** 120 /**
106 * Returns the last element of the list, or throws an out of bounds 121 * Returns the last element of the list, or throws an out of bounds
107 * exception if the list is empty. 122 * exception if the list is empty.
108 */ 123 */
109 E last(); 124 E last();
110 125
111 /** 126 /**
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 * not extendable. 162 * not extendable.
148 * If [length] is 0, this method does not do anything. 163 * If [length] is 0, this method does not do anything.
149 * If [start] is the length of the list, this method inserts the 164 * If [start] is the length of the list, this method inserts the
150 * range at the end of the list. 165 * range at the end of the list.
151 * Throws an [IllegalArgumentException] if [length] is negative. 166 * Throws an [IllegalArgumentException] if [length] is negative.
152 * Throws an [IndexOutOfRangeException] if [start] is negative or if 167 * Throws an [IndexOutOfRangeException] if [start] is negative or if
153 * [start] is greater than the length of the list. 168 * [start] is greater than the length of the list.
154 */ 169 */
155 void insertRange(int start, int length, [E initialValue]); 170 void insertRange(int start, int length, [E initialValue]);
156 } 171 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/lib/interceptors.dart ('k') | runtime/lib/array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698