OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart._collection.dev; | 5 part of dart._collection.dev; |
6 | 6 |
7 /** | 7 /** |
8 * Class implementing the read-operations on [List]. | 8 * Class implementing the read-operations on [List]. |
9 * | 9 * |
10 * Implements all read-only operations, except [:operator[]:] and [:length:], | 10 * Implements all read-only operations, except [:operator[]:] and [:length:], |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 } | 294 } |
295 | 295 |
296 class ReversedListIterable<E> extends ListIterable<E> { | 296 class ReversedListIterable<E> extends ListIterable<E> { |
297 Iterable<E> _source; | 297 Iterable<E> _source; |
298 ReversedListIterable(this._source); | 298 ReversedListIterable(this._source); |
299 | 299 |
300 int get length => _source.length; | 300 int get length => _source.length; |
301 | 301 |
302 E elementAt(int index) => _source.elementAt(_source.length - 1 - index); | 302 E elementAt(int index) => _source.elementAt(_source.length - 1 - index); |
303 } | 303 } |
| 304 |
| 305 /** |
| 306 * An [Iterable] of the UTF-16 code units of a [String] in index order. |
| 307 */ |
| 308 class CodeUnits extends UnmodifiableListBase<int> { |
| 309 /** The string that this is the code units of. */ |
| 310 String _string; |
| 311 |
| 312 CodeUnits(this._string); |
| 313 |
| 314 int get length => _string.length; |
| 315 int operator[](int i) => _string.codeUnitAt(i); |
| 316 } |
OLD | NEW |