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

Side by Side Diff: sdk/lib/core/comparable.dart

Issue 110483006: Add priority queue to package:collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Improve test layout/comments. Created 6 years, 11 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
« no previous file with comments | « pkg/collection/test/priority_queue_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * The signature of a generic comparison function. 8 * The signature of a generic comparison function.
9 * 9 *
10 * A comparison function represents an ordering on a type of objects. 10 * A comparison function represents an ordering on a type of objects.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 * Returns a value like a [Comparator] when comparing [:this:] to [other]. 56 * Returns a value like a [Comparator] when comparing [:this:] to [other].
57 * 57 *
58 * May throw an [ArgumentError] if [other] is of a type that 58 * May throw an [ArgumentError] if [other] is of a type that
59 * is not comparable to [:this:]. 59 * is not comparable to [:this:].
60 */ 60 */
61 int compareTo(T other); 61 int compareTo(T other);
62 62
63 /** 63 /**
64 * A [Comparator] that compares one comparable to another. 64 * A [Comparator] that compares one comparable to another.
65 * 65 *
66 * It returns the result of `a.compareTo(b)`.
67 *
66 * This utility function is used as the default comparator 68 * This utility function is used as the default comparator
67 * for ordering collections, for example in the [List] sort function. 69 * for ordering collections, for example in the [List] sort function.
68 */ 70 */
69 static int compare(Comparable a, Comparable b) => a.compareTo(b); 71 static int compare(Comparable a, Comparable b) => a.compareTo(b);
70 } 72 }
OLDNEW
« no previous file with comments | « pkg/collection/test/priority_queue_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698