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 class LinkedHashSet<E> extends _HashSetBase<E> { | 7 class LinkedHashSet<E> extends _HashSetBase<E> { |
8 | 8 |
9 external LinkedHashSet(); | 9 external LinkedHashSet(); |
10 | 10 |
11 factory LinkedHashSet.from(Iterable<E> iterable) { | 11 factory LinkedHashSet.from(Iterable<E> iterable) { |
12 return new LinkedHashSet<E>()..addAll(iterable); | 12 return new LinkedHashSet<E>()..addAll(iterable); |
13 } | 13 } |
14 | 14 |
15 // Iterable. | 15 // Iterable. |
16 external Iterator<E> get iterator; | 16 external Iterator<E> get iterator; |
17 | 17 |
18 external int get length; | 18 external int get length; |
19 | 19 |
20 external bool get isEmpty; | 20 external bool get isEmpty; |
21 | 21 |
| 22 external bool get isNotEmpty; |
| 23 |
22 external bool contains(Object object); | 24 external bool contains(Object object); |
23 | 25 |
24 external void forEach(void action(E element)); | 26 external void forEach(void action(E element)); |
25 | 27 |
26 external E get first; | 28 external E get first; |
27 | 29 |
28 external E get last; | 30 external E get last; |
29 | 31 |
30 E get single { | 32 E get single { |
31 if (length == 1) return first; | 33 if (length == 1) return first; |
(...skipping 12 matching lines...) Expand all Loading... |
44 | 46 |
45 external void removeWhere(bool test(E element)); | 47 external void removeWhere(bool test(E element)); |
46 | 48 |
47 external void retainWhere(bool test(E element)); | 49 external void retainWhere(bool test(E element)); |
48 | 50 |
49 external void clear(); | 51 external void clear(); |
50 | 52 |
51 // Set. | 53 // Set. |
52 Set<E> _newSet() => new LinkedHashSet<E>(); | 54 Set<E> _newSet() => new LinkedHashSet<E>(); |
53 } | 55 } |
OLD | NEW |