Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: sdk/lib/collection/linked_hash_set.dart

Issue 12413023: "Reverting 19985" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/collection/hash_set.dart ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 class LinkedHashSet<E> extends Collection<E> implements Set<E> { 7 class LinkedHashSet<E> extends Collection<E> implements Set<E> {
8 static const int _INITIAL_CAPACITY = 8; 8 static const int _INITIAL_CAPACITY = 8;
9 _LinkedHashTable<E> _table; 9 _LinkedHashTable<E> _table;
10 10
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 void retainWhere(bool test(E element)) { 122 void retainWhere(bool test(E element)) {
123 _filterWhere(test, false); 123 _filterWhere(test, false);
124 } 124 }
125 125
126 void clear() { 126 void clear() {
127 _table._clear(); 127 _table._clear();
128 } 128 }
129 129
130 // Set. 130 // Set.
131 bool isSubsetOf(Collection<E> other) { 131 bool isSubsetOf(Set<E> other) {
132 // Deprecated, and using old signature. 132 return IterableMixinWorkaround.isSubsetOfSet(this, other);
133 Set otherSet;
134 if (other is Set) {
135 otherSet = other;
136 } else {
137 otherSet = other.toSet();
138 }
139 return IterableMixinWorkaround.setContainsAll(otherSet, this);
140 } 133 }
141 134
142 bool containsAll(Iterable<E> other) { 135 bool containsAll(Set<E> other) {
143 return IterableMixinWorkaround.setContainsAll(this, other); 136 return IterableMixinWorkaround.isSubsetOfSet(other, this);
144 } 137 }
145 138
146 Set<E> intersection(Set<E> other) { 139 Set<E> intersection(Set<E> other) {
147 return IterableMixinWorkaround.setIntersection( 140 return IterableMixinWorkaround.setIntersection(
148 this, other, new LinkedHashSet<E>()); 141 this, other, new LinkedHashSet<E>());
149 } 142 }
150 143
151 Set<E> union(Set<E> other) { 144 Set<E> union(Set<E> other) {
152 return IterableMixinWorkaround.setUnion( 145 return IterableMixinWorkaround.setUnion(
153 this, other, new LinkedHashSet<E>()); 146 this, other, new LinkedHashSet<E>());
154 } 147 }
155 148
156 Set<E> difference(Set<E> other) { 149 Set<E> difference(Set<E> other) {
157 return IterableMixinWorkaround.setDifference( 150 return IterableMixinWorkaround.setDifference(
158 this, other, new LinkedHashSet<E>()); 151 this, other, new LinkedHashSet<E>());
159 } 152 }
160 153
161 String toString() => Collections.collectionToString(this); 154 String toString() => Collections.collectionToString(this);
162 } 155 }
OLDNEW
« no previous file with comments | « sdk/lib/collection/hash_set.dart ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698