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

Side by Side Diff: sdk/lib/core/set.dart

Issue 11366111: Make Iterable more powerful (and lazy). (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Fix current. was in Iterable and not Iterator. 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
« no previous file with comments | « sdk/lib/core/sequences.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * This class is the public interface of a set. A set is a collection 6 * This class is the public interface of a set. A set is a collection
7 * without duplicates. 7 * without duplicates.
8 */ 8 */
9 abstract class Set<E> extends Collection<E> { 9 abstract class Set<E> extends Collection<E> {
10 factory Set() => new _HashSetImpl<E>(); 10 factory Set() => new _HashSetImpl<E>();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 * Returns a new set which is the intersection between this set and 58 * Returns a new set which is the intersection between this set and
59 * the given collection. 59 * the given collection.
60 */ 60 */
61 Set<E> intersection(Collection<E> other); 61 Set<E> intersection(Collection<E> other);
62 62
63 /** 63 /**
64 * Removes all elements in the set. 64 * Removes all elements in the set.
65 */ 65 */
66 void clear(); 66 void clear();
67 67
68 /**
69 * Returns an immutable view of [this].
70 *
71 * The returned [Set] is backed by [this] but cannot change [this].
72 */
73 Set<E> get view;
68 } 74 }
69 75
70 abstract class HashSet<E> extends Set<E> { 76 abstract class HashSet<E> extends Set<E> {
71 factory HashSet() => new _HashSetImpl<E>(); 77 factory HashSet() => new _HashSetImpl<E>();
72 78
73 /** 79 /**
74 * Creates a [Set] that contains all elements of [other]. 80 * Creates a [Set] that contains all elements of [other].
75 */ 81 */
76 factory HashSet.from(Iterable<E> other) => new _HashSetImpl<E>.from(other); 82 factory HashSet.from(Iterable<E> other) => new _HashSetImpl<E>.from(other);
77 } 83 }
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 } 244 }
239 245
240 // The entries in the set. May contain null or the sentinel value. 246 // The entries in the set. May contain null or the sentinel value.
241 List<E> _entries; 247 List<E> _entries;
242 248
243 // The next valid index in [_entries] or the length of [entries_]. 249 // The next valid index in [_entries] or the length of [entries_].
244 // If it is the length of [_entries], calling [hasNext] on the 250 // If it is the length of [_entries], calling [hasNext] on the
245 // iterator will return false. 251 // iterator will return false.
246 int _nextValidIndex; 252 int _nextValidIndex;
247 } 253 }
OLDNEW
« no previous file with comments | « sdk/lib/core/sequences.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698