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

Side by Side Diff: test/generated_sdk/lib/collection/linked_hash_set.dart

Issue 1122313002: Typing fixes to eliminate casts/dcalls (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Rebase Created 5 years, 7 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
OLDNEW
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; 5 part of dart.collection;
6 6
7 /** 7 /**
8 * A [LinkedHashSet] is a hash-table based [Set] implementation. 8 * A [LinkedHashSet] is a hash-table based [Set] implementation.
9 * 9 *
10 * The `LinkedHashSet` also keep track of the order that elements were inserted 10 * The `LinkedHashSet` also keep track of the order that elements were inserted
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 * If [isValidKey] is omitted, it defaults to testing if the object is an 47 * If [isValidKey] is omitted, it defaults to testing if the object is an
48 * [E] instance. 48 * [E] instance.
49 * 49 *
50 * If you supply one of [equals] and [hashCode], 50 * If you supply one of [equals] and [hashCode],
51 * you should generally also to supply the other. 51 * you should generally also to supply the other.
52 * An example would be using [identical] and [identityHashCode], 52 * An example would be using [identical] and [identityHashCode],
53 * which is equivalent to using the shorthand [LinkedSet.identity]). 53 * which is equivalent to using the shorthand [LinkedSet.identity]).
54 */ 54 */
55 factory LinkedHashSet({ bool equals(E e1, E e2), 55 factory LinkedHashSet({ bool equals(E e1, E e2),
56 int hashCode(E e), 56 int hashCode(E e),
57 bool isValidKey(potentialKey) }) { 57 bool isValidKey(Object potentialKey) }) {
58 if (isValidKey == null) { 58 if (isValidKey == null) {
59 if (hashCode == null) { 59 if (hashCode == null) {
60 if (equals == null) { 60 if (equals == null) {
61 return new _LinkedHashSet<E>(); 61 return new _LinkedHashSet<E>();
62 } 62 }
63 hashCode = _defaultHashCode; 63 hashCode = _defaultHashCode;
64 } else { 64 } else {
65 if (identical(identityHashCode, hashCode) && 65 if (identical(identityHashCode, hashCode) &&
66 identical(identical, equals)) { 66 identical(identical, equals)) {
67 return new _LinkedIdentityHashSet<E>(); 67 return new _LinkedIdentityHashSet<E>();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 * 117 *
118 * The elements are iterated in insertion order. 118 * The elements are iterated in insertion order.
119 */ 119 */
120 void forEach(void action(E element)); 120 void forEach(void action(E element));
121 121
122 /** 122 /**
123 * Provides an iterator that iterates over the elements in insertion order. 123 * Provides an iterator that iterates over the elements in insertion order.
124 */ 124 */
125 Iterator<E> get iterator; 125 Iterator<E> get iterator;
126 } 126 }
OLDNEW
« no previous file with comments | « test/generated_sdk/lib/collection/linked_hash_map.dart ('k') | test/generated_sdk/lib/collection/set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698