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> factory ListFactory { | 9 interface List<E> extends Collection<E> factory ListFactory { |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 * and return | 69 * and return |
70 * | 70 * |
71 * an integer strictly less than 0 if a < b, | 71 * an integer strictly less than 0 if a < b, |
72 * 0 if a = b, and | 72 * 0 if a = b, and |
73 * an integer strictly greater than 0 if a > b. | 73 * an integer strictly greater than 0 if a > b. |
74 */ | 74 */ |
75 void sort(int compare(E a, E b)); | 75 void sort(int compare(E a, E b)); |
76 | 76 |
77 /** | 77 /** |
78 * Returns the first index of [element] in this list. Searches this | 78 * Returns the first index of [element] in this list. Searches this |
79 * list from index [startIndex] to the length of the list. Returns | 79 * list from index [start] to the length of the list. Returns |
80 * -1 if [element] is not found. | 80 * -1 if [element] is not found. |
81 */ | 81 */ |
82 int indexOf(E element, int startIndex); | 82 int indexOf(E element, [int start]); |
83 | 83 |
84 /** | 84 /** |
85 * Returns the last index of [element] in this list. Searches this | 85 * Returns the last index of [element] in this list. Searches this |
86 * list from index [startIndex] to 0. Returns -1 if [element] is | 86 * list from index [start] (inclusive) to 0. Returns -1 if |
87 * not found. | 87 * [element] is not found. |
88 */ | 88 */ |
89 int lastIndexOf(E element, int startIndex); | 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 * Pops and returns the last element of the list. | 99 * Pops and returns the last element of the list. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 * not extendable. | 150 * not extendable. |
151 * If [length] is 0, this method does not do anything. | 151 * If [length] is 0, this method does not do anything. |
152 * If [start] is the length of the array, this method inserts the | 152 * If [start] is the length of the array, this method inserts the |
153 * range at the end of the array. | 153 * range at the end of the array. |
154 * Throws an [IllegalArgumentException] if [length] is negative. | 154 * Throws an [IllegalArgumentException] if [length] is negative. |
155 * Throws an [IndexOutOfRangeException] if [start] or | 155 * Throws an [IndexOutOfRangeException] if [start] or |
156 * [:start + length:] are out of range. | 156 * [:start + length:] are out of range. |
157 */ | 157 */ |
158 void insertRange(int start, int length, [E initialValue]); | 158 void insertRange(int start, int length, [E initialValue]); |
159 } | 159 } |
OLD | NEW |