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

Side by Side Diff: sdk/lib/async/stream.dart

Issue 16285004: Better documentation on Sets and Maps, and more. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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.async; 5 part of dart.async;
6 6
7 // ------------------------------------------------------------------- 7 // -------------------------------------------------------------------
8 // Core Stream types 8 // Core Stream types
9 // ------------------------------------------------------------------- 9 // -------------------------------------------------------------------
10 10
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 * events of one kind into outgoing events of (possibly) another kind. 1026 * events of one kind into outgoing events of (possibly) another kind.
1027 * 1027 *
1028 * Subscribing on the stream returned by [bind] is the same as subscribing on 1028 * Subscribing on the stream returned by [bind] is the same as subscribing on
1029 * the source stream, except that events are passed through the [transformer] 1029 * the source stream, except that events are passed through the [transformer]
1030 * before being emitted. The transformer may generate any number and 1030 * before being emitted. The transformer may generate any number and
1031 * types of events for each incoming event. Pauses on the returned 1031 * types of events for each incoming event. Pauses on the returned
1032 * subscription are forwarded to this stream. 1032 * subscription are forwarded to this stream.
1033 * 1033 *
1034 * An example that duplicates all data events: 1034 * An example that duplicates all data events:
1035 * 1035 *
1036 * class DoubleTransformer<T> extends StreamEventTransformerBase<T, T> { 1036 * class DoubleTransformer<T> extends StreamEventTransformer<T, T> {
1037 * void handleData(T data, EventSink<T> sink) { 1037 * void handleData(T data, EventSink<T> sink) {
1038 * sink.add(value); 1038 * sink.add(value);
1039 * sink.add(value); 1039 * sink.add(value);
1040 * } 1040 * }
1041 * } 1041 * }
1042 * someTypeStream.transform(new DoubleTransformer<Type>()); 1042 * someTypeStream.transform(new DoubleTransformer<Type>());
1043 * 1043 *
1044 * The default implementations of the "handle" methods forward 1044 * The default implementations of the "handle" methods forward
1045 * the events unmodified. If using the default [handleData] the generic type [T] 1045 * the events unmodified. If using the default [handleData] the generic type [T]
1046 * needs to be assignable to [S]. 1046 * needs to be assignable to [S].
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 * 1241 *
1242 * If a [moveNext] call has been made, it will complete with `false` as value, 1242 * If a [moveNext] call has been made, it will complete with `false` as value,
1243 * as will all further calls to [moveNext]. 1243 * as will all further calls to [moveNext].
1244 * 1244 *
1245 * If you need to stop listening for values before the stream iterator is 1245 * If you need to stop listening for values before the stream iterator is
1246 * automatically closed, you must call [cancel] to ensure that the stream 1246 * automatically closed, you must call [cancel] to ensure that the stream
1247 * is properly closed. 1247 * is properly closed.
1248 */ 1248 */
1249 void cancel(); 1249 void cancel();
1250 } 1250 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/lib/string_helper.dart ('k') | sdk/lib/collection/hash_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698