OLD | NEW |
1 // -- start List<$E> mixins. | 1 // -- start List<$E> mixins. |
2 // $E is the element type. | 2 // $E is the element type. |
3 | 3 |
4 // From Iterable<$E>: | 4 // From Iterable<$E>: |
5 | 5 |
6 Iterator<$E> iterator() { | 6 Iterator<$E> iterator() { |
7 // Note: NodeLists are not fixed size. And most probably length shouldn't | 7 // Note: NodeLists are not fixed size. And most probably length shouldn't |
8 // be cached in both iterator _and_ forEach method. For now caching it | 8 // be cached in both iterator _and_ forEach method. For now caching it |
9 // for consistency. | 9 // for consistency. |
10 return new _FixedSizeListIterator<$E>(this); | 10 return new _FixedSizeListIterator<$E>(this); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 if (start === null) start = length - 1; | 50 if (start === null) start = length - 1; |
51 return _Lists.lastIndexOf(this, element, start); | 51 return _Lists.lastIndexOf(this, element, start); |
52 } | 52 } |
53 | 53 |
54 $E last() => this[length - 1]; | 54 $E last() => this[length - 1]; |
55 | 55 |
56 $E removeLast() { | 56 $E removeLast() { |
57 throw const UnsupportedOperationException("Cannot removeLast on immutable Li
st."); | 57 throw const UnsupportedOperationException("Cannot removeLast on immutable Li
st."); |
58 } | 58 } |
59 | 59 |
60 // FIXME: implement these. | |
61 void setRange(int start, int rangeLength, List<$E> from, [int startFrom]) { | 60 void setRange(int start, int rangeLength, List<$E> from, [int startFrom]) { |
62 throw const UnsupportedOperationException("Cannot setRange on immutable List
."); | 61 throw const UnsupportedOperationException("Cannot setRange on immutable List
."); |
63 } | 62 } |
64 | 63 |
65 void removeRange(int start, int rangeLength) { | 64 void removeRange(int start, int rangeLength) { |
66 throw const UnsupportedOperationException("Cannot removeRange on immutable L
ist."); | 65 throw const UnsupportedOperationException("Cannot removeRange on immutable L
ist."); |
67 } | 66 } |
68 | 67 |
69 void insertRange(int start, int rangeLength, [$E initialValue]) { | 68 void insertRange(int start, int rangeLength, [$E initialValue]) { |
70 throw const UnsupportedOperationException("Cannot insertRange on immutable L
ist."); | 69 throw const UnsupportedOperationException("Cannot insertRange on immutable L
ist."); |
71 } | 70 } |
72 | 71 |
73 List<$E> getRange(int start, int rangeLength) => | 72 List<$E> getRange(int start, int rangeLength) => |
74 _Lists.getRange(this, start, rangeLength, <$E>[]); | 73 _Lists.getRange(this, start, rangeLength, <$E>[]); |
75 | 74 |
76 // -- end List<$E> mixins. | 75 // -- end List<$E> mixins. |
OLD | NEW |