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

Side by Side Diff: dart/samples/dartiverse_search/search_engine.dart

Issue 60293003: Version 0.8.10.5 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 part of search_engine;
6
7
8 /**
9 * A [SearchEngine] provides the ability to search for a given string.
10 */
11 abstract class SearchEngine {
12 /**
13 * Get the name of the search engine.
14 */
15 String get name;
16
17 /**
18 * Perform a search for [input]. The returned [Stream] will complete
19 * when there are no more results.
20 */
21 Stream<SearchResult> search(String input);
22 }
23
24
25 /**
26 * A [SearchResult] entry, returned by [SearchEngine.search].
27 */
28 class SearchResult {
29 /**
30 * The title of the result.
31 */
32 final String title;
33
34 /**
35 * The link of the result.
36 */
37 final String link;
38
39 /**
40 * Create a new [SearchResult] from a title and a link.
41 */
42 SearchResult(this.title, this.link);
43 }
OLDNEW
« no previous file with comments | « dart/samples/dartiverse_search/pubspec.yaml ('k') | dart/samples/dartiverse_search/stack_overflow_search_engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698