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

Side by Side Diff: sdk/lib/core/set.dart

Issue 26832002: Add Set.lookup method to get the instance in the set. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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/_internal/lib/collection_patch.dart ('k') | sdk/lib/html/dartium/html_dartium.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * A collection of objects in which each object can occur only once. 8 * A collection of objects in which each object can occur only once.
9 * 9 *
10 * That is, for each object of the element type, the object is either considered 10 * That is, for each object of the element type, the object is either considered
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 void addAll(Iterable<E> elements); 68 void addAll(Iterable<E> elements);
69 69
70 /** 70 /**
71 * Removes [value] from the set. Returns true if [value] was 71 * Removes [value] from the set. Returns true if [value] was
72 * in the set. Returns false otherwise. The method has no effect 72 * in the set. Returns false otherwise. The method has no effect
73 * if [value] value was not in the set. 73 * if [value] value was not in the set.
74 */ 74 */
75 bool remove(Object value); 75 bool remove(Object value);
76 76
77 /** 77 /**
78 * If an object equal to [object] is in the set, return it.
79 *
80 * Checks if there is an object in the set that is equal to [object].
81 * If so, that object is returned, otherwise returns null.
82 */
83 E lookup(Object object);
84
85 /**
78 * Removes each element of [elements] from this set. 86 * Removes each element of [elements] from this set.
79 */ 87 */
80 void removeAll(Iterable<Object> elements); 88 void removeAll(Iterable<Object> elements);
81 89
82 /** 90 /**
83 * Removes all elements of this set that are not elements in [elements]. 91 * Removes all elements of this set that are not elements in [elements].
84 */ 92 */
85 void retainAll(Iterable<Object> elements); 93 void retainAll(Iterable<Object> elements);
86 94
87 /** 95 /**
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 * That is, the returned set contains all the elements of this `Set` that 129 * That is, the returned set contains all the elements of this `Set` that
122 * are not elements of [other]. 130 * are not elements of [other].
123 */ 131 */
124 Set<E> difference(Set<E> other); 132 Set<E> difference(Set<E> other);
125 133
126 /** 134 /**
127 * Removes all elements in the set. 135 * Removes all elements in the set.
128 */ 136 */
129 void clear(); 137 void clear();
130 } 138 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/lib/collection_patch.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698