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

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

Issue 15263004: Adding isNotEmpty property to collection and string. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix template generation Created 7 years, 6 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
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 HashMap<K, V> implements Map<K, V> { 7 class HashMap<K, V> implements Map<K, V> {
8 external HashMap(); 8 external HashMap();
9 9
10 factory HashMap.from(Map<K, V> other) { 10 factory HashMap.from(Map<K, V> other) {
11 return new HashMap<K, V>()..addAll(other); 11 return new HashMap<K, V>()..addAll(other);
12 } 12 }
13 13
14 external int get length; 14 external int get length;
15 external bool get isEmpty; 15 external bool get isEmpty;
16 external bool get isNotEmpty;
16 17
17 external Iterable<K> get keys; 18 external Iterable<K> get keys;
18 external Iterable<V> get values; 19 external Iterable<V> get values;
19 20
20 external bool containsKey(K key); 21 external bool containsKey(K key);
21 external bool containsValue(V value); 22 external bool containsValue(V value);
22 23
23 external void addAll(Map<K, V> other); 24 external void addAll(Map<K, V> other);
24 25
25 external V operator [](K key); 26 external V operator [](K key);
26 external void operator []=(K key, V value); 27 external void operator []=(K key, V value);
27 28
28 external V putIfAbsent(K key, V ifAbsent()); 29 external V putIfAbsent(K key, V ifAbsent());
29 30
30 external V remove(K key); 31 external V remove(K key);
31 external void clear(); 32 external void clear();
32 33
33 external void forEach(void action(K key, V value)); 34 external void forEach(void action(K key, V value));
34 35
35 String toString() => Maps.mapToString(this); 36 String toString() => Maps.mapToString(this);
36 } 37 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/mirrors/util.dart ('k') | sdk/lib/collection/hash_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698