| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 /** | 5 /** |
| 6 * Base implementations of [Set]. | 6 * Base implementations of [Set]. |
| 7 */ | 7 */ |
| 8 part of dart.collection; | 8 part of dart.collection; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 */ | 26 */ |
| 27 abstract class SetMixin<E> implements Set<E> { | 27 abstract class SetMixin<E> implements Set<E> { |
| 28 // This class reimplements all of [IterableMixin]. | 28 // This class reimplements all of [IterableMixin]. |
| 29 // If/when Dart mixins get more powerful, we should just create a single | 29 // If/when Dart mixins get more powerful, we should just create a single |
| 30 // Mixin class from IterableMixin and the new methods of thisclass. | 30 // Mixin class from IterableMixin and the new methods of thisclass. |
| 31 | 31 |
| 32 bool add(E element); | 32 bool add(E element); |
| 33 | 33 |
| 34 bool contains(Object element); | 34 bool contains(Object element); |
| 35 | 35 |
| 36 E lookup(E element); | 36 E lookup(Object element); |
| 37 | 37 |
| 38 bool remove(Object element); | 38 bool remove(Object element); |
| 39 | 39 |
| 40 Iterator<E> get iterator; | 40 Iterator<E> get iterator; |
| 41 | 41 |
| 42 Set<E> toSet(); | 42 Set<E> toSet(); |
| 43 | 43 |
| 44 int get length; | 44 int get length; |
| 45 | 45 |
| 46 bool get isEmpty => length == 0; | 46 bool get isEmpty => length == 0; |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 abstract class SetBase<E> extends SetMixin<E> { | 302 abstract class SetBase<E> extends SetMixin<E> { |
| 303 /** | 303 /** |
| 304 * Convert a `Set` to a string as `{each, element, as, string}`. | 304 * Convert a `Set` to a string as `{each, element, as, string}`. |
| 305 * | 305 * |
| 306 * Handles circular references where converting one of the elements | 306 * Handles circular references where converting one of the elements |
| 307 * to a string ends up converting [set] to a string again. | 307 * to a string ends up converting [set] to a string again. |
| 308 */ | 308 */ |
| 309 static String setToString(Set set) => | 309 static String setToString(Set set) => |
| 310 IterableBase.iterableToFullString(set, '{', '}'); | 310 IterableBase.iterableToFullString(set, '{', '}'); |
| 311 } | 311 } |
| OLD | NEW |