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

Side by Side Diff: lib/compiler/implementation/util/link.dart

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 1 month 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
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 class Link<T> implements Iterable<T> { 5 class Link<T> implements Iterable<T> {
6 T get head => null; 6 T get head => null;
7 Link<T> get tail => null; 7 Link<T> get tail => null;
8 8
9 factory Link.fromList(List<T> list) { 9 factory Link.fromList(List<T> list) {
10 switch (list.length) { 10 switch (list.length) {
(...skipping 21 matching lines...) Expand all
32 return new LinkEntry<T>(element, this); 32 return new LinkEntry<T>(element, this);
33 } 33 }
34 34
35 Iterator<T> iterator() => new LinkIterator<T>(this); 35 Iterator<T> iterator() => new LinkIterator<T>(this);
36 36
37 void printOn(StringBuffer buffer, [separatedBy]) { 37 void printOn(StringBuffer buffer, [separatedBy]) {
38 } 38 }
39 39
40 List toList() => new List<T>(0); 40 List toList() => new List<T>(0);
41 41
42 bool isEmpty() => true; 42 bool get isEmpty => true;
43 43
44 Link<T> reverse() => this; 44 Link<T> reverse() => this;
45 45
46 Link<T> reversePrependAll(Link<T> from) { 46 Link<T> reversePrependAll(Link<T> from) {
47 if (from.isEmpty()) return this; 47 if (from.isEmpty) return this;
48 return this.prepend(from.head).reversePrependAll(from.tail); 48 return this.prepend(from.head).reversePrependAll(from.tail);
49 } 49 }
50 50
51 void forEach(void f(T element)) {} 51 void forEach(void f(T element)) {}
52 52
53 bool operator ==(other) { 53 bool operator ==(other) {
54 if (other is !Link<T>) return false; 54 if (other is !Link<T>) return false;
55 return other.isEmpty(); 55 return other.isEmpty;
56 } 56 }
57 57
58 String toString() => "[]"; 58 String toString() => "[]";
59 } 59 }
60 60
61 interface LinkBuilder<T> default LinkBuilderImplementation<T> { 61 interface LinkBuilder<T> default LinkBuilderImplementation<T> {
62 LinkBuilder(); 62 LinkBuilder();
63 63
64 Link<T> toLink(); 64 Link<T> toLink();
65 void addLast(T t); 65 void addLast(T t);
66 66
67 final int length; 67 final int length;
68 } 68 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/universe/universe.dart ('k') | lib/compiler/implementation/util/link_implementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698