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

Side by Side Diff: pkg/collection/README.md

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 | « no previous file | pkg/collection/lib/collection.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Helper libraries for working with collections. 1 Helper libraries for working with collections.
2 2
3 The `collection` package contains a number of separate libraries 3 The `collection` package contains a number of separate libraries
4 with utility functions and classes that makes working with collections easier. 4 with utility functions and classes that makes working with collections easier.
5 5
6 ## Using 6 ## Using
7 7
8 The `collection` package can be imported as separate libraries, or 8 The `collection` package can be imported as separate libraries, or
9 in totality: 9 in totality:
10 10
11 import 'package:collection/algorithms.dart';
11 import 'package:collection/equality.dart'; 12 import 'package:collection/equality.dart';
12 import 'package:collection/algorithms.dart'; 13 import 'package:collection/iterable_zip.dart';
14 import 'package:collection/priority_queue.dart';
13 import 'package:collection/wrappers.dart'; 15 import 'package:collection/wrappers.dart';
14 16
15 or 17 or
16 18
17 import 'package:collection/collection.dart'; 19 import 'package:collection/collection.dart';
18 20
21 ## Algorithms
22
23 The algorithms library contains functions that operate on lists.
24
25 It contains ways to shuffle a `List`, do binary search on a sorted `List`, and
26 various sorting algorithms.
27
28
19 ## Equality 29 ## Equality
20 30
21 The equality library gives a way to specify equality of elements and 31 The equality library gives a way to specify equality of elements and
22 collections. 32 collections.
23 33
24 Collections in Dart have no inherent equality. Two sets are not equal, even 34 Collections in Dart have no inherent equality. Two sets are not equal, even
25 if they contain exactly the same objects as elements. 35 if they contain exactly the same objects as elements.
26 36
27 The equality library provides a way to say define such an equality. In this 37 The equality library provides a way to say define such an equality. In this
28 case, for example, `const SetEquality(const IdentityEquality())` is an equality 38 case, for example, `const SetEquality(const IdentityEquality())` is an equality
29 that considers two sets equal exactly if they contain identical elements. 39 that considers two sets equal exactly if they contain identical elements.
30 40
31 The library provides ways to define equalities on `Iterable`s, `List`s, `Set`s, and 41 The library provides ways to define equalities on `Iterable`s, `List`s, `Set`s,
32 `Map`s, as well as combinations of these, such as: 42 and `Map`s, as well as combinations of these, such as:
33 43
34 const MapEquality(const IdentityEquality(), const ListEquality()); 44 const MapEquality(const IdentityEquality(), const ListEquality());
35 45
36 This equality considers maps equal if they have identical keys, and the correspo nding values are lists with equal (`operator==`) values. 46 This equality considers maps equal if they have identical keys, and the
47 corresponding values are lists with equal (`operator==`) values.
37 48
38 ## Algorithms
39 49
40 The algorithms library contains functions that operate on lists. 50 ## Iterable Zip
41 51
42 It contains ways to shuffle a `List`, do binary search on a sorted `List`, and 52 Utilities for "zipping" a list of iterables into an iterable of lists.
43 some different sorting algorithms. 53
54
55 ## Priority Queue
56
57 An interface and implemention of a priority queue.
44 58
45 59
46 ## Wrappers 60 ## Wrappers
47 61
48 The wrappers library contains classes that "wrap" a collection. 62 The wrappers library contains classes that "wrap" a collection.
49 63
50 A wrapper class contains an object of the same type, and it forwards all 64 A wrapper class contains an object of the same type, and it forwards all
51 methods to the wrapped object. 65 methods to the wrapped object.
52 66
53 Wrapper classes can be used in various ways, for example to restrict the type 67 Wrapper classes can be used in various ways, for example to restrict the type
54 of an object to that of a supertype, or to change the behavior of selected 68 of an object to that of a supertype, or to change the behavior of selected
55 functions on an existing object. 69 functions on an existing object.
OLDNEW
« no previous file with comments | « no previous file | pkg/collection/lib/collection.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698