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

Unified Diff: sdk/lib/internal/list.dart

Issue 2754013002: Format all dart: library files (Closed)
Patch Set: Format all dart: library files Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/internal/iterable.dart ('k') | sdk/lib/internal/sort.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/internal/list.dart
diff --git a/sdk/lib/internal/list.dart b/sdk/lib/internal/list.dart
index 2f249f89996b6b0b4080bf4012302f7b5a885e2f..624a3ed776957a97a489d41d79b76fa709e77490 100644
--- a/sdk/lib/internal/list.dart
+++ b/sdk/lib/internal/list.dart
@@ -18,74 +18,62 @@ abstract class FixedLengthListMixin<E> {
/** This operation is not supported by a fixed length list. */
void add(E value) {
- throw new UnsupportedError(
- "Cannot add to a fixed-length list");
+ throw new UnsupportedError("Cannot add to a fixed-length list");
}
/** This operation is not supported by a fixed length list. */
void insert(int index, E value) {
- throw new UnsupportedError(
- "Cannot add to a fixed-length list");
+ throw new UnsupportedError("Cannot add to a fixed-length list");
}
/** This operation is not supported by a fixed length list. */
void insertAll(int at, Iterable<E> iterable) {
- throw new UnsupportedError(
- "Cannot add to a fixed-length list");
+ throw new UnsupportedError("Cannot add to a fixed-length list");
}
/** This operation is not supported by a fixed length list. */
void addAll(Iterable<E> iterable) {
- throw new UnsupportedError(
- "Cannot add to a fixed-length list");
+ throw new UnsupportedError("Cannot add to a fixed-length list");
}
/** This operation is not supported by a fixed length list. */
bool remove(Object element) {
- throw new UnsupportedError(
- "Cannot remove from a fixed-length list");
+ throw new UnsupportedError("Cannot remove from a fixed-length list");
}
/** This operation is not supported by a fixed length list. */
void removeWhere(bool test(E element)) {
- throw new UnsupportedError(
- "Cannot remove from a fixed-length list");
+ throw new UnsupportedError("Cannot remove from a fixed-length list");
}
/** This operation is not supported by a fixed length list. */
void retainWhere(bool test(E element)) {
- throw new UnsupportedError(
- "Cannot remove from a fixed-length list");
+ throw new UnsupportedError("Cannot remove from a fixed-length list");
}
/** This operation is not supported by a fixed length list. */
void clear() {
- throw new UnsupportedError(
- "Cannot clear a fixed-length list");
+ throw new UnsupportedError("Cannot clear a fixed-length list");
}
/** This operation is not supported by a fixed length list. */
E removeAt(int index) {
- throw new UnsupportedError(
- "Cannot remove from a fixed-length list");
+ throw new UnsupportedError("Cannot remove from a fixed-length list");
}
/** This operation is not supported by a fixed length list. */
E removeLast() {
- throw new UnsupportedError(
- "Cannot remove from a fixed-length list");
+ throw new UnsupportedError("Cannot remove from a fixed-length list");
}
/** This operation is not supported by a fixed length list. */
void removeRange(int start, int end) {
- throw new UnsupportedError(
- "Cannot remove from a fixed-length list");
+ throw new UnsupportedError("Cannot remove from a fixed-length list");
}
/** This operation is not supported by a fixed length list. */
void replaceRange(int start, int end, Iterable<E> iterable) {
- throw new UnsupportedError(
- "Cannot remove from a fixed-length list");
+ throw new UnsupportedError("Cannot remove from a fixed-length list");
}
}
@@ -97,11 +85,9 @@ abstract class FixedLengthListMixin<E> {
* unmodifiable lists.
*/
abstract class UnmodifiableListMixin<E> implements List<E> {
-
/** This operation is not supported by an unmodifiable list. */
void operator []=(int index, E value) {
- throw new UnsupportedError(
- "Cannot modify an unmodifiable list");
+ throw new UnsupportedError("Cannot modify an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
@@ -112,104 +98,87 @@ abstract class UnmodifiableListMixin<E> implements List<E> {
/** This operation is not supported by an unmodifiable list. */
void setAll(int at, Iterable<E> iterable) {
- throw new UnsupportedError(
- "Cannot modify an unmodifiable list");
+ throw new UnsupportedError("Cannot modify an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
void add(E value) {
- throw new UnsupportedError(
- "Cannot add to an unmodifiable list");
+ throw new UnsupportedError("Cannot add to an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
void insert(int index, E element) {
- throw new UnsupportedError(
- "Cannot add to an unmodifiable list");
+ throw new UnsupportedError("Cannot add to an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
void insertAll(int at, Iterable<E> iterable) {
- throw new UnsupportedError(
- "Cannot add to an unmodifiable list");
+ throw new UnsupportedError("Cannot add to an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
void addAll(Iterable<E> iterable) {
- throw new UnsupportedError(
- "Cannot add to an unmodifiable list");
+ throw new UnsupportedError("Cannot add to an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
bool remove(Object element) {
- throw new UnsupportedError(
- "Cannot remove from an unmodifiable list");
+ throw new UnsupportedError("Cannot remove from an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
void removeWhere(bool test(E element)) {
- throw new UnsupportedError(
- "Cannot remove from an unmodifiable list");
+ throw new UnsupportedError("Cannot remove from an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
void retainWhere(bool test(E element)) {
- throw new UnsupportedError(
- "Cannot remove from an unmodifiable list");
+ throw new UnsupportedError("Cannot remove from an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
void sort([Comparator<E> compare]) {
- throw new UnsupportedError(
- "Cannot modify an unmodifiable list");
+ throw new UnsupportedError("Cannot modify an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
void shuffle([Random random]) {
- throw new UnsupportedError(
- "Cannot modify an unmodifiable list");
+ throw new UnsupportedError("Cannot modify an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
void clear() {
- throw new UnsupportedError(
- "Cannot clear an unmodifiable list");
+ throw new UnsupportedError("Cannot clear an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
E removeAt(int index) {
- throw new UnsupportedError(
- "Cannot remove from an unmodifiable list");
+ throw new UnsupportedError("Cannot remove from an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
E removeLast() {
- throw new UnsupportedError(
- "Cannot remove from an unmodifiable list");
+ throw new UnsupportedError("Cannot remove from an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
- throw new UnsupportedError(
- "Cannot modify an unmodifiable list");
+ throw new UnsupportedError("Cannot modify an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
void removeRange(int start, int end) {
- throw new UnsupportedError(
- "Cannot remove from an unmodifiable list");
+ throw new UnsupportedError("Cannot remove from an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
void replaceRange(int start, int end, Iterable<E> iterable) {
- throw new UnsupportedError(
- "Cannot remove from an unmodifiable list");
+ throw new UnsupportedError("Cannot remove from an unmodifiable list");
}
/** This operation is not supported by an unmodifiable list. */
void fillRange(int start, int end, [E fillValue]) {
- throw new UnsupportedError(
- "Cannot modify an unmodifiable list");
+ throw new UnsupportedError("Cannot modify an unmodifiable list");
}
}
@@ -219,8 +188,8 @@ abstract class UnmodifiableListMixin<E> implements List<E> {
* All operations are defined in terms of `length`, `operator[]` and
* `operator[]=`, which need to be implemented.
*/
-abstract class FixedLengthListBase<E> =
- ListBase<E> with FixedLengthListMixin<E>;
+abstract class FixedLengthListBase<E> = ListBase<E>
+ with FixedLengthListMixin<E>;
/**
* Abstract implementation of an unmodifiable list.
@@ -228,8 +197,8 @@ abstract class FixedLengthListBase<E> =
* All operations are defined in terms of `length` and `operator[]`,
* which need to be implemented.
*/
-abstract class UnmodifiableListBase<E> =
- ListBase<E> with UnmodifiableListMixin<E>;
+abstract class UnmodifiableListBase<E> = ListBase<E>
+ with UnmodifiableListMixin<E>;
class _ListIndicesIterable extends ListIterable<int> {
List _backedList;
@@ -248,7 +217,7 @@ class ListMapView<E> implements Map<int, E> {
ListMapView(this._values);
- E operator[] (Object key) => containsKey(key) ? _values[key] : null;
+ E operator [](Object key) => containsKey(key) ? _values[key] : null;
int get length => _values.length;
Iterable<E> get values => new SubListIterable<E>(_values, 0, null);
@@ -270,7 +239,7 @@ class ListMapView<E> implements Map<int, E> {
}
/** This operation is not supported by an unmodifiable map. */
- void operator[]= (int key, E value) {
+ void operator []=(int key, E value) {
throw new UnsupportedError("Cannot modify an unmodifiable map");
}
@@ -313,21 +282,20 @@ class ReversedListIterable<E> extends ListIterable<E> {
*/
abstract class UnmodifiableListError {
/** Error thrown when trying to add elements to an unmodifiable list. */
- static UnsupportedError add()
- => new UnsupportedError("Cannot add to unmodifiable List");
+ static UnsupportedError add() =>
+ new UnsupportedError("Cannot add to unmodifiable List");
/** Error thrown when trying to add elements to an unmodifiable list. */
- static UnsupportedError change()
- => new UnsupportedError(
- "Cannot change the content of an unmodifiable List");
+ static UnsupportedError change() =>
+ new UnsupportedError("Cannot change the content of an unmodifiable List");
/** Error thrown when trying to change the length of an unmodifiable list. */
- static UnsupportedError length()
- => new UnsupportedError("Cannot change length of unmodifiable List");
+ static UnsupportedError length() =>
+ new UnsupportedError("Cannot change length of unmodifiable List");
/** Error thrown when trying to remove elements from an unmodifiable list. */
- static UnsupportedError remove()
- => new UnsupportedError("Cannot remove from unmodifiable List");
+ static UnsupportedError remove() =>
+ new UnsupportedError("Cannot remove from unmodifiable List");
}
/**
@@ -337,16 +305,16 @@ abstract class UnmodifiableListError {
*/
abstract class NonGrowableListError {
/** Error thrown when trying to add elements to an non-growable list. */
- static UnsupportedError add()
- => new UnsupportedError("Cannot add to non-growable List");
+ static UnsupportedError add() =>
+ new UnsupportedError("Cannot add to non-growable List");
/** Error thrown when trying to change the length of an non-growable list. */
- static UnsupportedError length()
- => new UnsupportedError("Cannot change length of non-growable List");
+ static UnsupportedError length() =>
+ new UnsupportedError("Cannot change length of non-growable List");
/** Error thrown when trying to remove elements from an non-growable list. */
- static UnsupportedError remove()
- => new UnsupportedError("Cannot remove from non-growable List");
+ static UnsupportedError remove() =>
+ new UnsupportedError("Cannot remove from non-growable List");
}
/**
« no previous file with comments | « sdk/lib/internal/iterable.dart ('k') | sdk/lib/internal/sort.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698