OLD | NEW |
---|---|
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 import "dart:collection"; | 5 import "dart:collection"; |
6 import "dart:math" as math; | 6 import "dart:math" as math; |
7 | 7 |
8 import "typed_wrappers.dart"; | 8 import "typed_wrappers.dart"; |
9 import "unmodifiable_wrappers.dart"; | 9 import "unmodifiable_wrappers.dart"; |
10 | 10 |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
442 /// | 442 /// |
443 /// That is, the returned set contains all the elements of this [Set] that are | 443 /// That is, the returned set contains all the elements of this [Set] that are |
444 /// also elements of [other] according to `other.contains`. | 444 /// also elements of [other] according to `other.contains`. |
445 /// | 445 /// |
446 /// Note that the returned set will use the default equality operation, which | 446 /// Note that the returned set will use the default equality operation, which |
447 /// may be different than the equality operation [this] uses. | 447 /// may be different than the equality operation [this] uses. |
448 Set<E> intersection(Set<Object> other) => where(other.contains).toSet(); | 448 Set<E> intersection(Set<Object> other) => where(other.contains).toSet(); |
449 | 449 |
450 /// Throws an [UnsupportedError] since there's no corresponding method for | 450 /// Throws an [UnsupportedError] since there's no corresponding method for |
451 /// [Map]s. | 451 /// [Map]s. |
452 E lookup(E element) => | 452 E lookup(Object element) => |
Jennifer Messerly
2017/07/19 23:47:36
after this change, this is now a valid implementat
| |
453 throw new UnsupportedError("MapKeySet doesn't support lookup()."); | 453 throw new UnsupportedError("MapKeySet doesn't support lookup()."); |
454 | 454 |
455 /// Returns a new set which contains all the elements of [this] and [other]. | 455 /// Returns a new set which contains all the elements of [this] and [other]. |
456 /// | 456 /// |
457 /// That is, the returned set contains all the elements of this [Set] and all | 457 /// That is, the returned set contains all the elements of this [Set] and all |
458 /// the elements of [other]. | 458 /// the elements of [other]. |
459 /// | 459 /// |
460 /// Note that the returned set will use the default equality operation, which | 460 /// Note that the returned set will use the default equality operation, which |
461 /// may be different than the equality operation [this] uses. | 461 /// may be different than the equality operation [this] uses. |
462 Set<E> union(Set<E> other) => toSet()..addAll(other); | 462 Set<E> union(Set<E> other) => toSet()..addAll(other); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
596 | 596 |
597 /// Returns a new set which contains all the elements of [this] and [other]. | 597 /// Returns a new set which contains all the elements of [this] and [other]. |
598 /// | 598 /// |
599 /// That is, the returned set contains all the elements of this [Set] and all | 599 /// That is, the returned set contains all the elements of this [Set] and all |
600 /// the elements of [other]. | 600 /// the elements of [other]. |
601 /// | 601 /// |
602 /// Note that the returned set will use the default equality operation, which | 602 /// Note that the returned set will use the default equality operation, which |
603 /// may be different than the equality operation [this] uses. | 603 /// may be different than the equality operation [this] uses. |
604 Set<V> union(Set<V> other) => toSet()..addAll(other); | 604 Set<V> union(Set<V> other) => toSet()..addAll(other); |
605 } | 605 } |
OLD | NEW |