OLD | NEW |
1 part of dart._internal; | 1 part of dart._internal; |
2 abstract class FixedLengthListMixin<E> {void set length(int newLength) { | 2 abstract class FixedLengthListMixin<E> {void set length(int newLength) { |
3 throw new UnsupportedError("Cannot change the length of a fixed-length list"); | 3 throw new UnsupportedError("Cannot change the length of a fixed-length list"); |
4 } | 4 } |
5 void add(E value) { | 5 void add(E value) { |
6 throw new UnsupportedError("Cannot add to a fixed-length list"); | 6 throw new UnsupportedError("Cannot add to a fixed-length list"); |
7 } | 7 } |
8 void insert(int index, E value) { | 8 void insert(int index, E value) { |
9 throw new UnsupportedError("Cannot add to a fixed-length list"); | 9 throw new UnsupportedError("Cannot add to a fixed-length list"); |
10 } | 10 } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 class _ListIndicesIterable extends ListIterable<int> {List _backedList; | 102 class _ListIndicesIterable extends ListIterable<int> {List _backedList; |
103 _ListIndicesIterable(this._backedList); | 103 _ListIndicesIterable(this._backedList); |
104 int get length => _backedList.length; | 104 int get length => _backedList.length; |
105 int elementAt(int index) { | 105 int elementAt(int index) { |
106 RangeError.checkValidIndex(index, this); | 106 RangeError.checkValidIndex(index, this); |
107 return index; | 107 return index; |
108 } | 108 } |
109 } | 109 } |
110 class ListMapView<E> implements Map<int, E> {List<E> _values; | 110 class ListMapView<E> implements Map<int, E> {List<E> _values; |
111 ListMapView(this._values); | 111 ListMapView(this._values); |
112 E operator [](Object key) => containsKey(key) ? _values[key] : null; | 112 E operator [](Object key) => containsKey(key) ? _values[DEVC$RT.cast(key, Objec
t, int, "ImplicitCast", """line 251, column 59 of dart:_internal/list.dart: """,
key is int, true)] : null; |
113 int get length => _values.length; | 113 int get length => _values.length; |
114 Iterable<E> get values => new SubListIterable<E>(_values, 0, null); | 114 Iterable<E> get values => new SubListIterable<E>(_values, 0, null); |
115 Iterable<int> get keys => new _ListIndicesIterable(_values); | 115 Iterable<int> get keys => new _ListIndicesIterable(_values); |
116 bool get isEmpty => _values.isEmpty; | 116 bool get isEmpty => _values.isEmpty; |
117 bool get isNotEmpty => _values.isNotEmpty; | 117 bool get isNotEmpty => _values.isNotEmpty; |
118 bool containsValue(Object value) => _values.contains(value); | 118 bool containsValue(Object value) => _values.contains(value); |
119 bool containsKey(Object key) => key is int && key >= 0 && key < length; | 119 bool containsKey(Object key) => key is int && key >= 0 && key < length; |
120 void forEach(void f(int key, E value)) { | 120 void forEach(void f(int key, E value)) { |
121 int length = _values.length; | 121 int length = _values.length; |
122 for (int i = 0; i < length; i++) { | 122 for (int i = 0; i < length; i++) { |
(...skipping 28 matching lines...) Expand all Loading... |
151 abstract class UnmodifiableListError {static UnsupportedError add() => new Unsu
pportedError("Cannot add to unmodifiable List"); | 151 abstract class UnmodifiableListError {static UnsupportedError add() => new Unsu
pportedError("Cannot add to unmodifiable List"); |
152 static UnsupportedError change() => new UnsupportedError("Cannot change the con
tent of an unmodifiable List"); | 152 static UnsupportedError change() => new UnsupportedError("Cannot change the con
tent of an unmodifiable List"); |
153 static UnsupportedError length() => new UnsupportedError("Cannot change length
of unmodifiable List"); | 153 static UnsupportedError length() => new UnsupportedError("Cannot change length
of unmodifiable List"); |
154 static UnsupportedError remove() => new UnsupportedError("Cannot remove from un
modifiable List"); | 154 static UnsupportedError remove() => new UnsupportedError("Cannot remove from un
modifiable List"); |
155 } | 155 } |
156 abstract class NonGrowableListError {static UnsupportedError add() => new Unsup
portedError("Cannot add to non-growable List"); | 156 abstract class NonGrowableListError {static UnsupportedError add() => new Unsup
portedError("Cannot add to non-growable List"); |
157 static UnsupportedError length() => new UnsupportedError("Cannot change length
of non-growable List"); | 157 static UnsupportedError length() => new UnsupportedError("Cannot change length
of non-growable List"); |
158 static UnsupportedError remove() => new UnsupportedError("Cannot remove from no
n-growable List"); | 158 static UnsupportedError remove() => new UnsupportedError("Cannot remove from no
n-growable List"); |
159 } | 159 } |
160 external List makeListFixedLength(List growableList) ; | 160 external List makeListFixedLength(List growableList) ; |
OLD | NEW |