angular-cn/modules/facade/src/collection.dart

27 lines
723 B
Dart
Raw Normal View History

library facade.collection;
import 'dart:collection' show HashMap;
export 'dart:collection' show Map;
export 'dart:core' show List;
class MapWrapper {
static HashMap create() => new HashMap();
static get(m, k) => m[k];
static void set(m, k, v){ m[k] = v; }
static contains(m, k) => m.containsKey(k);
}
class ListWrapper {
static List clone(List l) => new List.from(l);
static List create() => new List();
static get(m, k) => m[k];
static void set(m, k, v) { m[k] = v; }
static contains(m, k) => m.containsKey(k);
static void push(List l, e) { l.add(e); }
}
class SetWrapper {
static Set createFromList(List l) { return new Set.from(l); }
static bool has(Set s, key) { return s.contains(key); }
}