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

Side by Side Diff: client/dom/templates/immutable_list_mixin.darttemplate

Issue 9845043: Rename client/{dom,html} to lib/{dom,html} . (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // -- start List<$E> mixins.
2 // $E is the element type.
3
4 // From Iterable<$E>:
5
6 Iterator<$E> iterator() {
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
9 // for consistency.
10 return new _FixedSizeListIterator<$E>(this);
11 }
12
13 // From Collection<$E>:
14
15 void add($E value) {
16 throw new UnsupportedOperationException("Cannot add to immutable List.");
17 }
18
19 void addLast($E value) {
20 throw new UnsupportedOperationException("Cannot add to immutable List.");
21 }
22
23 void addAll(Collection<$E> collection) {
24 throw new UnsupportedOperationException("Cannot add to immutable List.");
25 }
26
27 void forEach(void f($E element)) => _Collections.forEach(this, f);
28
29 Collection map(f($E element)) => _Collections.map(this, [], f);
30
31 Collection<$E> filter(bool f($E element)) =>
32 _Collections.filter(this, <$E>[], f);
33
34 bool every(bool f($E element)) => _Collections.every(this, f);
35
36 bool some(bool f($E element)) => _Collections.some(this, f);
37
38 bool isEmpty() => this.length == 0;
39
40 // From List<$E>:
41
42 void sort(int compare($E a, $E b)) {
43 throw new UnsupportedOperationException("Cannot sort immutable List.");
44 }
45
46 int indexOf($E element, [int start = 0]) =>
47 _Lists.indexOf(this, element, start, this.length);
48
49 int lastIndexOf($E element, [int start = 0]) =>
50 _Lists.lastIndexOf(this, element, start);
51
52 $E last() => this[length - 1];
53
54 // FIXME: implement thesee.
55 void setRange(int start, int length, List<$E> from, [int startFrom]) {
56 throw new UnsupportedOperationException("Cannot setRange on immutable List." );
57 }
58 void removeRange(int start, int length) {
59 throw new UnsupportedOperationException("Cannot removeRange on immutable Lis t.");
60 }
61 void insertRange(int start, int length, [$E initialValue]) {
62 throw new UnsupportedOperationException("Cannot insertRange on immutable Lis t.");
63 }
64 List<$E> getRange(int start, int length) =>
65 _Lists.getRange(this, start, length, <$E>[]);
66
67 // -- end List<$E> mixins.
OLDNEW
« no previous file with comments | « client/dom/templates/html/interface/interface_XMLHttpRequest.darttemplate ('k') | client/dom/templates/interface.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698