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

Side by Side Diff: sdk/lib/io/platform_impl.dart

Issue 14246008: Allow Object when doing lookups. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot to upload before committing 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.io; 5 part of dart.io;
6 6
7 class _Platform { 7 class _Platform {
8 external static int _numberOfProcessors(); 8 external static int _numberOfProcessors();
9 external static String _pathSeparator(); 9 external static String _pathSeparator();
10 external static String _operatingSystem(); 10 external static String _operatingSystem();
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 _CaseInsensitiveStringMap() : _map = new Map<String, V>(); 65 _CaseInsensitiveStringMap() : _map = new Map<String, V>();
66 66
67 _CaseInsensitiveStringMap.from(Map<String, V> other) 67 _CaseInsensitiveStringMap.from(Map<String, V> other)
68 : _map = new Map<String, V>() { 68 : _map = new Map<String, V>() {
69 other.forEach((String key, V value) { 69 other.forEach((String key, V value) {
70 _map[key.toUpperCase()] = value; 70 _map[key.toUpperCase()] = value;
71 }); 71 });
72 } 72 }
73 73
74 bool containsKey(String key) => _map.containsKey(key.toUpperCase()); 74 bool containsKey(String key) => _map.containsKey(key.toUpperCase());
75 bool containsValue(V value) => _map.containsValue(value); 75 bool containsValue(Object value) => _map.containsValue(value);
76 V operator [](String key) => _map[key.toUpperCase()]; 76 V operator [](String key) => _map[key.toUpperCase()];
77 void operator []=(String key, V value) { 77 void operator []=(String key, V value) {
78 _map[key.toUpperCase()] = value; 78 _map[key.toUpperCase()] = value;
79 } 79 }
80 V putIfAbsent(String key, V ifAbsent()) { 80 V putIfAbsent(String key, V ifAbsent()) {
81 _map.putIfAbsent(key.toUpperCase(), ifAbsent); 81 _map.putIfAbsent(key.toUpperCase(), ifAbsent);
82 } 82 }
83 addAll(Map other) { 83 addAll(Map other) {
84 other.forEach((key, value) => this[key.toUpperCase()] = value); 84 other.forEach((key, value) => this[key.toUpperCase()] = value);
85 } 85 }
86 V remove(String key) => _map.remove(key.toUpperCase()); 86 V remove(String key) => _map.remove(key.toUpperCase());
87 void clear() => _map.clear(); 87 void clear() => _map.clear();
88 void forEach(void f(String key, V value)) => _map.forEach(f); 88 void forEach(void f(String key, V value)) => _map.forEach(f);
89 Iterable<String> get keys => _map.keys; 89 Iterable<String> get keys => _map.keys;
90 Iterable<V> get values => _map.values; 90 Iterable<V> get values => _map.values;
91 int get length => _map.length; 91 int get length => _map.length;
92 bool get isEmpty => _map.isEmpty; 92 bool get isEmpty => _map.isEmpty;
93 bool get isNotEmpty => _map.isNotEmpty; 93 bool get isNotEmpty => _map.isNotEmpty;
94 94
95 Map<String, V> _map; 95 Map<String, V> _map;
96 } 96 }
OLDNEW
« no previous file with comments | « sdk/lib/html/html_common/filtered_element_list.dart ('k') | sdk/lib/typed_data/dart2js/typed_data_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698