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

Unified Diff: test/generated_sdk/lib/collection/linked_hash_map.dart

Issue 1162723007: remove generated_sdk from checked in code (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 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
Index: test/generated_sdk/lib/collection/linked_hash_map.dart
diff --git a/test/generated_sdk/lib/collection/linked_hash_map.dart b/test/generated_sdk/lib/collection/linked_hash_map.dart
deleted file mode 100644
index 098767eccf80f1cd85c9fb6b3379740869043c07..0000000000000000000000000000000000000000
--- a/test/generated_sdk/lib/collection/linked_hash_map.dart
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of dart.collection;
-
-/**
- * A hash-table based implementation of [Map].
- *
- * The insertion order of keys is remembered,
- * and keys are iterated in the order they were inserted into the map.
- * Values are iterated in their corresponding key's order.
- * Changing a key's value, when the key is already in the map,
- * does not change the iteration order,
- * but removing the key and adding it again
- * will make it be last in the iteration order.
- *
- * The keys of a `LinkedHashMap` must have consistent [Object.operator==]
- * and [Object.hashCode] implementations. This means that the `==` operator
- * must define a stable equivalence relation on the keys (reflexive,
- * symmetric, transitive, and consistent over time), and that `hashCode`
- * must be the same for objects that are considered equal by `==`.
- *
- * The map allows `null` as a key.
- */
-abstract class LinkedHashMap<K, V> implements HashMap<K, V> {
- /**
- * Creates an insertion-ordered hash-table based [Map].
- *
- * If [equals] is provided, it is used to compare the keys in the table with
- * new keys. If [equals] is omitted, the key's own [Object.operator==] is used
- * instead.
- *
- * Similar, if [hashCode] is provided, it is used to produce a hash value
- * for keys in order to place them in the hash table. If it is omitted, the
- * key's own [Object.hashCode] is used.
- *
- * If using methods like [operator[]], [remove] and [containsKey] together
- * with a custom equality and hashcode, an extra `isValidKey` function
- * can be supplied. This function is called before calling [equals] or
- * [hashCode] with an argument that may not be a [K] instance, and if the
- * call returns false, the key is assumed to not be in the set.
- * The [isValidKey] function defaults to just testing if the object is a
- * [K] instance.
- *
- * The used `equals` and `hashCode` method should always be consistent,
- * so that if `equals(a, b)` then `hashCode(a) == hashCode(b)`. The hash
- * of an object, or what it compares equal to, should not change while the
- * object is in the table. If it does change, the result is unpredictable.
- *
- * If you supply one of [equals] and [hashCode],
- * you should generally also to supply the other.
- * An example would be using [identical] and [identityHashCode],
- * which is equivalent to using the shorthand [LinkedHashMap.identity]).
- */
- factory LinkedHashMap({ bool equals(K key1, K key2),
- int hashCode(K key),
- bool isValidKey(Object potentialKey) }) {
- if (isValidKey == null) {
- if (hashCode == null) {
- if (equals == null) {
- return new _LinkedHashMap<K, V>();
- }
- hashCode = _defaultHashCode;
- } else {
- if (identical(identityHashCode, hashCode) &&
- identical(identical, equals)) {
- return new _LinkedIdentityHashMap<K, V>();
- }
- if (equals == null) {
- equals = _defaultEquals;
- }
- }
- } else {
- if (hashCode == null) {
- hashCode = _defaultHashCode;
- }
- if (equals == null) {
- equals = _defaultEquals;
- }
- }
- return new _LinkedCustomHashMap<K, V>(equals, hashCode, isValidKey);
- }
-
- /**
- * Creates an insertion-ordered identity-based map.
- *
- * Effectively a shorthand for:
- *
- * new LinkedHashMap(equals: identical, hashCode: identityHashCodeOf)
- */
- factory LinkedHashMap.identity() = _LinkedIdentityHashMap<K, V>;
-
- /**
- * Creates a [LinkedHashMap] that contains all key value pairs of [other].
- */
- factory LinkedHashMap.from(Map other) {
- LinkedHashMap<K, V> result = new LinkedHashMap<K, V>();
- other.forEach((k, v) { result[k] = v; });
- return result;
- }
-
- /**
- * Creates a [LinkedHashMap] where the keys and values are computed from the
- * [iterable].
- *
- * For each element of the [iterable] this constructor computes a key/value
- * pair, by applying [key] and [value] respectively.
- *
- * The keys of the key/value pairs do not need to be unique. The last
- * occurrence of a key will simply overwrite any previous value.
- *
- * If no values are specified for [key] and [value] the default is the
- * identity function.
- */
- factory LinkedHashMap.fromIterable(Iterable iterable,
- {K key(element), V value(element)}) {
- LinkedHashMap<K, V> map = new LinkedHashMap<K, V>();
- Maps._fillMapWithMappedIterable(map, iterable, key, value);
- return map;
- }
-
- /**
- * Creates a [LinkedHashMap] associating the given [keys] to [values].
- *
- * This constructor iterates over [keys] and [values] and maps each element of
- * [keys] to the corresponding element of [values].
- *
- * If [keys] contains the same object multiple times, the last occurrence
- * overwrites the previous value.
- *
- * It is an error if the two [Iterable]s don't have the same length.
- */
- factory LinkedHashMap.fromIterables(Iterable<K> keys, Iterable<V> values) {
- LinkedHashMap<K, V> map = new LinkedHashMap<K, V>();
- Maps._fillMapWithIterables(map, keys, values);
- return map;
- }
-
- @NoInline()
- factory LinkedHashMap._literal(List keyValuePairs) {
- return fillLiteralMap(keyValuePairs, new _LinkedHashMap<K, V>());
- }
-
- @NoThrows() @NoInline()
- factory LinkedHashMap._empty() {
- return new _LinkedHashMap<K, V>();
- }
-}
« no previous file with comments | « test/generated_sdk/lib/collection/iterator.dart ('k') | test/generated_sdk/lib/collection/linked_hash_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698