| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // TODO(srdjan): Use shared array implementation. | 6 // TODO(srdjan): Use shared array implementation. |
| 7 class _ObjectArray<E> implements List<E> { | 7 class _ObjectArray<E> implements List<E> { |
| 8 | 8 |
| 9 factory _ObjectArray(int length) native "ObjectArray_allocate"; | 9 factory _ObjectArray(int length) native "ObjectArray_allocate"; |
| 10 | 10 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 E elementAt(int index) { | 149 E elementAt(int index) { |
| 150 return this[index]; | 150 return this[index]; |
| 151 } | 151 } |
| 152 | 152 |
| 153 bool get isEmpty { | 153 bool get isEmpty { |
| 154 return this.length == 0; | 154 return this.length == 0; |
| 155 } | 155 } |
| 156 | 156 |
| 157 void sort([int compare(E a, E b)]) { | 157 void sort([int compare(E a, E b)]) { |
| 158 if (compare == null) compare = Comparable.compare; | 158 IterableMixinWorkaround.sortList(this, compare); |
| 159 _Sort.sort(this, compare); | |
| 160 } | 159 } |
| 161 | 160 |
| 162 int indexOf(E element, [int start = 0]) { | 161 int indexOf(E element, [int start = 0]) { |
| 163 return Arrays.indexOf(this, element, start, this.length); | 162 return Arrays.indexOf(this, element, start, this.length); |
| 164 } | 163 } |
| 165 | 164 |
| 166 int lastIndexOf(E element, [int start = null]) { | 165 int lastIndexOf(E element, [int start = null]) { |
| 167 if (start == null) start = length - 1; | 166 if (start == null) start = length - 1; |
| 168 return Arrays.lastIndexOf(this, element, start); | 167 return Arrays.lastIndexOf(this, element, start); |
| 169 } | 168 } |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 } | 484 } |
| 486 _position = _length; | 485 _position = _length; |
| 487 _current = null; | 486 _current = null; |
| 488 return false; | 487 return false; |
| 489 } | 488 } |
| 490 | 489 |
| 491 E get current { | 490 E get current { |
| 492 return _current; | 491 return _current; |
| 493 } | 492 } |
| 494 } | 493 } |
| OLD | NEW |