OLD | NEW |
| (Empty) |
1 part of dart.collection; | |
2 abstract class _HashSetBase<E> extends SetBase<E> {Set<E> difference(Set<Object
> other) { | |
3 Set<E> result = _newSet(); | |
4 for (var element in this) { | |
5 if (!other.contains(element)) result.add(element); | |
6 } | |
7 return result; | |
8 } | |
9 Set<E> intersection(Set<Object> other) { | |
10 Set<E> result = _newSet(); | |
11 for (var element in this) { | |
12 if (other.contains(element)) result.add(element); | |
13 } | |
14 return result; | |
15 } | |
16 Set<E> _newSet(); | |
17 Set<E> toSet() => _newSet()..addAll(this); | |
18 } | |
19 abstract class HashSet<E> implements Set<E> {external factory HashSet({ | |
20 bool equals(E e1, E e2), int hashCode(E e), bool isValidKey(potentialKey)} | |
21 ); | |
22 external factory HashSet.identity(); | |
23 factory HashSet.from(Iterable elements) { | |
24 HashSet<E> result = new HashSet<E>(); | |
25 for (E e in DEVC$RT.cast(elements, DEVC$RT.type((Iterable<dynamic> _) { | |
26 } | |
27 ), DEVC$RT.type((Iterable<E> _) { | |
28 } | |
29 ), "CompositeCast", """line 103, column 17 of dart:collection/hash_set.dart: """
, elements is Iterable<E>, false)) result.add(e); | |
30 return result; | |
31 } | |
32 Iterator<E> get iterator; | |
33 } | |
OLD | NEW |