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