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

Unified Diff: corelib/src/list.dart

Issue 10398052: Fix incorrect range check comments in List.*Range methods' documentation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporate comments. Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: corelib/src/list.dart
diff --git a/corelib/src/list.dart b/corelib/src/list.dart
index 36fad3d69d3550f763e9cfdc2c54ab2e9a8fb485..7d08788e177c4a9279f305210f9f0324930727cd 100644
--- a/corelib/src/list.dart
+++ b/corelib/src/list.dart
@@ -53,7 +53,7 @@ interface List<E> extends Collection<E> default ListFactory<E> {
void addLast(E value);
/**
- * Appends all elements of the [collection] to the end of list.
+ * Appends all elements of the [collection] to the end of the list.
* Extends the length of the list by the length of [collection].
* Throws an [UnsupportedOperationException] if the list is not
* extendable.
@@ -75,14 +75,14 @@ interface List<E> extends Collection<E> default ListFactory<E> {
void sort(int compare(E a, E b));
/**
- * Returns the first index of [element] in this list. Searches this
+ * Returns the first index of [element] in the list. Searches the
* list from index [start] to the length of the list. Returns
* -1 if [element] is not found.
*/
int indexOf(E element, [int start]);
/**
- * Returns the last index of [element] in this list. Searches this
+ * Returns the last index of [element] in the list. Searches the
* list from index [start] (inclusive) to 0. Returns -1 if
* [element] is not found.
*/
@@ -109,49 +109,48 @@ interface List<E> extends Collection<E> default ListFactory<E> {
E last();
/**
- * Returns a sub list copy of this list, from [start] to
- * [:start + length:].
+ * Returns a new list containing [length] elements from the list,
+ * starting at [start].
* Returns an empty list if [length] is 0.
* Throws an [IllegalArgumentException] if [length] is negative.
* Throws an [IndexOutOfRangeException] if [start] or
- * [:start + length:] are out of range.
+ * [:start + length - 1:] are out of range.
*/
List<E> getRange(int start, int length);
/**
- * Copies [length] elements of the [from] array, starting
- * from [startFrom], into [:this:], starting at [start].
+ * Copies [length] elements of [from], starting
+ * at [startFrom], into the list, starting at [start].
* If [length] is 0, this method does not do anything.
* Throws an [IllegalArgumentException] if [length] is negative.
* Throws an [IndexOutOfRangeException] if [start] or
- * [:start + length:] are out of range for [:this:], or if
- * [startFrom] is out of range for [from].
+ * [:start + length - 1:] are out of range for [:this:], or if
+ * [startFrom] or [:startFrom + length - 1:] are out of range for [from].
*/
void setRange(int start, int length, List<E> from, [int startFrom]);
/**
- * Removes the range in the list starting from [start] to
- * [:start + length:].
+ * Removes [length] elements from the list, beginning at [start].
* Throws an [UnsupportedOperationException] if the list is
* not extendable.
* If [length] is 0, this method does not do anything.
* Throws an [IllegalArgumentException] if [length] is negative.
* Throws an [IndexOutOfRangeException] if [start] or
- * [:start + length:] are out of range.
+ * [:start + length: - 1] are out of range.
*/
void removeRange(int start, int length);
/**
- * Inserts a new range in the list, starting from [start] to
- * [:start + length:]. The entries are filled with [initialValue].
+ * Inserts a new range into the list, starting from [start] to
+ * [:start + length - 1:]. The entries are filled with [initialValue].
* Throws an [UnsupportedOperationException] if the list is
* not extendable.
* If [length] is 0, this method does not do anything.
- * If [start] is the length of the array, this method inserts the
- * range at the end of the array.
+ * If [start] is the length of the list, this method inserts the
+ * range at the end of the list.
* Throws an [IllegalArgumentException] if [length] is negative.
- * Throws an [IndexOutOfRangeException] if [start] or
- * [:start + length:] are out of range.
+ * Throws an [IndexOutOfRangeException] if [start] is negative or if
+ * [start] is greater than the length of the list.
*/
void insertRange(int start, int length, [E initialValue]);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698