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

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

Issue 13530003: Deprecate Collection class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file. Created 7 years, 8 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 typedef void _CollectionSinkCallback<T>(Collection<T> collection); 7 typedef void _CollectionSinkCallback<T>(Collection<T> collection);
8 typedef void _CollectionSinkErrorCallback(AsyncError error); 8 typedef void _CollectionSinkErrorCallback(AsyncError error);
9 9
10 /** EventSink that stores incoming data in a collection. */ 10 /**
11 * EventSink that stores incoming data in a collection.
12 *
13 * *Deprecated*.
14 */
11 class CollectionSink<T> extends StreamSink<T> { 15 class CollectionSink<T> extends StreamSink<T> {
12 // TODO(8997): Implement EventSink instead. 16 // TODO(8997): Implement EventSink instead.
13 final Collection<T> collection; 17 final Collection<T> collection;
14 final _CollectionSinkCallback<T> _callback; 18 final _CollectionSinkCallback<T> _callback;
15 final _CollectionSinkErrorCallback _errorCallback; 19 final _CollectionSinkErrorCallback _errorCallback;
16 bool _isClosed = false; 20 bool _isClosed = false;
17 21
18 /** 22 /**
19 * Create a sink that stores incoming values in a collection. 23 * Create a sink that stores incoming values in a collection.
20 * 24 *
(...skipping 17 matching lines...) Expand all
38 if (_isClosed) throw new StateError("Adding error to closed sink"); 42 if (_isClosed) throw new StateError("Adding error to closed sink");
39 if (_errorCallback != null) _errorCallback(error); 43 if (_errorCallback != null) _errorCallback(error);
40 } 44 }
41 45
42 void close() { 46 void close() {
43 if (_isClosed) throw new StateError("Closing closed sink"); 47 if (_isClosed) throw new StateError("Closing closed sink");
44 _isClosed = true; 48 _isClosed = true;
45 if (_callback != null) _callback(collection); 49 if (_callback != null) _callback(collection);
46 } 50 }
47 } 51 }
OLDNEW
« no previous file with comments | « compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java ('k') | sdk/lib/core/collection.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698