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

Unified Diff: pkg/dartdoc/lib/src/mirrors/util.dart

Issue 10985085: Members and comments inherited in dartdoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart ('k') | pkg/dartdoc/static/styles.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dartdoc/lib/src/mirrors/util.dart
diff --git a/pkg/dartdoc/lib/src/mirrors/util.dart b/pkg/dartdoc/lib/src/mirrors/util.dart
index dca7a857c6bdf296dcbaab507cb700a402c60ea9..760b9d288fea7ca0e48db8375775097242c91417 100644
--- a/pkg/dartdoc/lib/src/mirrors/util.dart
+++ b/pkg/dartdoc/lib/src/mirrors/util.dart
@@ -12,15 +12,19 @@
*/
abstract class AbstractMap<K,V> implements Map<K,V> {
AbstractMap();
+
AbstractMap.from(Map<K,V> other) {
other.forEach((k,v) => this[k] = v);
}
+
void operator []=(K key, value) {
throw new UnsupportedOperationException('[]= is not supported');
}
+
void clear() {
throw new UnsupportedOperationException('clear() is not supported');
}
+
bool containsKey(K key) {
var found = false;
forEach((k,_) {
@@ -30,6 +34,7 @@ abstract class AbstractMap<K,V> implements Map<K,V> {
});
return found;
}
+
bool containsValue(V value) {
var found = false;
forEach((_,v) {
@@ -39,16 +44,19 @@ abstract class AbstractMap<K,V> implements Map<K,V> {
});
return found;
}
+
Collection<K> getKeys() {
var keys = <K>[];
forEach((k,_) => keys.add(k));
return keys;
}
+
Collection<V> getValues() {
var values = <V>[];
forEach((_,v) => values.add(v));
return values;
}
+
bool isEmpty() => length == 0;
V putIfAbsent(K key, V ifAbsent()) {
if (!containsKey(key)) {
@@ -58,6 +66,7 @@ abstract class AbstractMap<K,V> implements Map<K,V> {
}
return null;
}
+
V remove(K key) {
throw new UnsupportedOperationException('V remove(K key) is not supported');
}
@@ -146,7 +155,7 @@ class AsFilteredImmutableMap<K, Vin, Vout> extends AbstractMap<K, Vout> {
Vout operator [](K key) {
if (key is K) {
Vin value = _map[key];
- if (value !== null) {
+ if (value != null) {
return _filter(value);
}
}
@@ -156,7 +165,7 @@ class AsFilteredImmutableMap<K, Vin, Vout> extends AbstractMap<K, Vout> {
void forEach(void f(K key, Vout value)) {
_map.forEach((K k, Vin v) {
var value = _filter(v);
- if (value !== null) {
+ if (value != null) {
f(k, value);
}
});
« no previous file with comments | « pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart ('k') | pkg/dartdoc/static/styles.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698