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

Side by Side Diff: packages/collection/lib/src/equality_map.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 4 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
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
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.
4
5 import 'dart:collection';
6
7 import 'equality.dart';
8 import 'wrappers.dart';
9
10 /// A [Map] whose key equality is determined by an [Equality] object.
11 class EqualityMap<K, V> extends DelegatingMap<K, V> {
12 /// Creates a map with equality based on [equality].
13 EqualityMap(Equality<K> equality)
14 : super(new LinkedHashMap(
15 equals: equality.equals,
16 hashCode: equality.hash,
17 isValidKey: equality.isValidKey));
18
19 /// Creates a map with equality based on [equality] that contains all
20 /// key-value pairs of [other].
21 ///
22 /// If [other] has multiple keys that are equivalent according to [equality],
23 /// the last one reached during iteration takes precedence.
24 EqualityMap.from(Equality<K> equality, Map<K, V> other)
25 : super(new LinkedHashMap(
26 equals: equality.equals,
27 hashCode: equality.hash,
28 isValidKey: equality.isValidKey)) {
29 addAll(other);
30 }
31 }
OLDNEW
« no previous file with comments | « packages/collection/lib/src/equality.dart ('k') | packages/collection/lib/src/equality_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698