| OLD | NEW |
| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. | 99 * Removes the element at position[index] from the list. |
| 100 * | 100 * |
| 101 * This reduces the length of the list by one and moves all later elements | 101 * This reduces the length of the list by one and moves all later elements |
| 102 * down by one position. | 102 * down by one position. |
| 103 * Returns the removed element. | 103 * Returns the removed element. |
| 104 * Throws a [IllegalArgumentException] if [index] is not an integer, and | 104 * Throws an [IllegalArgumentException] if [index] is not an [int]. |
| 105 * [IndexOutOfRangeException] if the [index] does not point inside the list. | 105 * Throws an [IndexOutOfRangeException] if the [index] does not point inside |
| 106 * | 106 * the list. |
| 107 * Throws a [UnsupportedOperationException] if the list, or the length of | 107 * Throws an [UnsupportedOperationException] if the length of the list cannot |
| 108 * the list, cannot be changed. | 108 * be changed. |
| 109 */ | 109 */ |
| 110 E removeAt(int index); | 110 E removeAt(int index); |
| 111 | 111 |
| 112 /** | 112 /** |
| 113 * Pops and returns the last element of the list. | 113 * Pops and returns the last element of the list. |
| 114 * Throws a [UnsupportedOperationException] if the length of the | 114 * Throws a [UnsupportedOperationException] if the length of the |
| 115 * list cannot be changed. | 115 * list cannot be changed. |
| 116 * | |
| 117 */ | 116 */ |
| 118 E removeLast(); | 117 E removeLast(); |
| 119 | 118 |
| 120 /** | 119 /** |
| 121 * Returns the last element of the list, or throws an out of bounds | 120 * Returns the last element of the list, or throws an out of bounds |
| 122 * exception if the list is empty. | 121 * exception if the list is empty. |
| 123 */ | 122 */ |
| 124 E last(); | 123 E last(); |
| 125 | 124 |
| 126 /** | 125 /** |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 * not extendable. | 161 * not extendable. |
| 163 * If [length] is 0, this method does not do anything. | 162 * If [length] is 0, this method does not do anything. |
| 164 * If [start] is the length of the list, this method inserts the | 163 * If [start] is the length of the list, this method inserts the |
| 165 * range at the end of the list. | 164 * range at the end of the list. |
| 166 * Throws an [IllegalArgumentException] if [length] is negative. | 165 * Throws an [IllegalArgumentException] if [length] is negative. |
| 167 * Throws an [IndexOutOfRangeException] if [start] is negative or if | 166 * Throws an [IndexOutOfRangeException] if [start] is negative or if |
| 168 * [start] is greater than the length of the list. | 167 * [start] is greater than the length of the list. |
| 169 */ | 168 */ |
| 170 void insertRange(int start, int length, [E initialValue]); | 169 void insertRange(int start, int length, [E initialValue]); |
| 171 } | 170 } |
| OLD | NEW |