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<E> other) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 return new HashSet<E>()..addAll(iterable); | 63 return new HashSet<E>()..addAll(iterable); |
64 } | 64 } |
65 | 65 |
66 // Iterable. | 66 // Iterable. |
67 external Iterator<E> get iterator; | 67 external Iterator<E> get iterator; |
68 | 68 |
69 external int get length; | 69 external int get length; |
70 | 70 |
71 external bool get isEmpty; | 71 external bool get isEmpty; |
72 | 72 |
| 73 external bool get isNotEmpty; |
| 74 |
73 external bool contains(Object object); | 75 external bool contains(Object object); |
74 | 76 |
75 // Collection. | 77 // Collection. |
76 external void add(E element); | 78 external void add(E element); |
77 | 79 |
78 external void addAll(Iterable<E> objects); | 80 external void addAll(Iterable<E> objects); |
79 | 81 |
80 external bool remove(Object object); | 82 external bool remove(Object object); |
81 | 83 |
82 external void removeAll(Iterable objectsToRemove); | 84 external void removeAll(Iterable objectsToRemove); |
83 | 85 |
84 external void removeWhere(bool test(E element)); | 86 external void removeWhere(bool test(E element)); |
85 | 87 |
86 external void retainWhere(bool test(E element)); | 88 external void retainWhere(bool test(E element)); |
87 | 89 |
88 external void clear(); | 90 external void clear(); |
89 | 91 |
90 // Set. | 92 // Set. |
91 Set<E> _newSet() => new HashSet<E>(); | 93 Set<E> _newSet() => new HashSet<E>(); |
92 } | 94 } |
OLD | NEW |