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

Unified Diff: lib/core/set.dart

Issue 10950006: Convert most interfaces in dart:core to abstract classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/core/regexp.dart ('k') | lib/core/stopwatch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/core/set.dart
diff --git a/lib/core/set.dart b/lib/core/set.dart
index 5893cf22ff2307e37448770cded7a2ead97a6905..1652f4e23b7c754b95b0c490948a70f97e863212 100644
--- a/lib/core/set.dart
+++ b/lib/core/set.dart
@@ -6,14 +6,15 @@
* This class is the public interface of a set. A set is a collection
* without duplicates.
*/
-interface Set<E> extends Collection<E>
- default HashSetImplementation<E extends Hashable> {
- Set();
+abstract class Set<E> extends Collection<E> {
+ factory Set() => new HashSetImplementation<E>();
/**
* Creates a [Set] that contains all elements of [other].
*/
- Set.from(Iterable<E> other);
+ factory Set.from(Iterable<E> other) {
+ return new HashSetImplementation<E>.from(other);
+ }
/**
* Returns true if [value] is in the set.
@@ -68,12 +69,12 @@ interface Set<E> extends Collection<E>
}
-interface HashSet<E extends Hashable> extends Set<E>
- default HashSetImplementation<E extends Hashable> {
- HashSet();
+abstract class HashSet<E extends Hashable> extends Set<E> {
+ factory HashSet() => new HashSetImplementation<E>();
/**
* Creates a [Set] that contains all elements of [other].
*/
- HashSet.from(Iterable<E> other);
+ factory HashSet.from(Iterable<E> other) =>
+ new HashSetImplementation<E>.from(other);
}
« no previous file with comments | « lib/core/regexp.dart ('k') | lib/core/stopwatch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698