Chromium Code Reviews| 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 part of dart.collection; | 5 part of dart.collection; |
| 6 | 6 |
| 7 /** Common parts of [HashSet] and [LinkedHashSet] implementations. */ | 7 /** Common parts of [HashSet] and [LinkedHashSet] implementations. */ |
| 8 abstract class _HashSetBase<E> extends IterableBase<E> implements Set<E> { | 8 abstract class _HashSetBase<E> extends IterableBase<E> implements Set<E> { |
| 9 // Set. | 9 // Set. |
| 10 bool containsAll(Iterable<E> other) { | 10 bool containsAll(Iterable<Object> other) { |
| 11 for (E object in other) { | 11 for (Object object in other) { |
| 12 if (!this.contains(object)) return false; | 12 if (!this.contains(object)) return false; |
| 13 } | 13 } |
| 14 return true; | 14 return true; |
| 15 } | 15 } |
| 16 | 16 |
| 17 /** Create a new Set of the same type as this. */ | 17 /** Create a new Set of the same type as this. */ |
| 18 Set _newSet(); | 18 Set _newSet(); |
| 19 | 19 |
| 20 Set<E> intersection(Set<E> other) { | 20 Set<E> intersection(Set<E> other) { |
| 21 Set<E> result = _newSet(); | 21 Set<E> result = _newSet(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 | 72 |
| 73 external bool contains(Object object); | 73 external bool contains(Object object); |
| 74 | 74 |
| 75 // Collection. | 75 // Collection. |
| 76 external void add(E element); | 76 external void add(E element); |
| 77 | 77 |
| 78 external void addAll(Iterable<E> objects); | 78 external void addAll(Iterable<E> objects); |
| 79 | 79 |
| 80 external bool remove(Object object); | 80 external bool remove(Object object); |
| 81 | 81 |
| 82 external void removeAll(Iterable objectsToRemove); | 82 external void removeAll(Iterable objectsToRemove); |
|
Lasse Reichstein Nielsen
2013/04/30 07:42:27
Iterable<Object>?
floitsch
2013/06/17 18:25:34
Done.
| |
| 83 | 83 |
| 84 external void removeWhere(bool test(E element)); | 84 external void removeWhere(bool test(E element)); |
| 85 | 85 |
| 86 external void retainWhere(bool test(E element)); | 86 external void retainWhere(bool test(E element)); |
| 87 | 87 |
| 88 external void clear(); | 88 external void clear(); |
| 89 | 89 |
| 90 // Set. | 90 // Set. |
| 91 Set<E> _newSet() => new HashSet<E>(); | 91 Set<E> _newSet() => new HashSet<E>(); |
| 92 } | 92 } |
| OLD | NEW |