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

Side by Side Diff: sky/examples/stocks-fn/companylist.dart

Issue 971183002: Initial commit of Effen reactive framework experiment for Sky (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « sky/examples/fn/widgets/widgets.dart ('k') | sky/examples/stocks-fn/stockarrow.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 <script> 1 part of stocksapp;
2 import "dart:math";
3 2
4 // Snapshot from http://www.nasdaq.com/screening/company-list.aspx 3 // Snapshot from http://www.nasdaq.com/screening/company-list.aspx
5 // Fetched 2/23/2014. 4 // Fetched 2/23/2014.
6 // "Symbol","Name","LastSale","MarketCap","IPOyear","Sector","industry","Summary Quote", 5 // "Symbol","Name","LastSale","MarketCap","IPOyear","Sector","industry","Summary Quote",
7 final List<List<String>> _kCompanyList = [ 6 final List<List<String>> _kCompanyList = [
8 ["TFSC","1347 Capital Corp.","9.43","\$56.09M","2014","Finance","Business Serv ices","http://www.nasdaq.com/symbol/tfsc"], 7 ["TFSC","1347 Capital Corp.","9.43","\$56.09M","2014","Finance","Business Serv ices","http://www.nasdaq.com/symbol/tfsc"],
9 ["TFSCR","1347 Capital Corp.","0.37","n/a","2014","Finance","Business Services ","http://www.nasdaq.com/symbol/tfscr"], 8 ["TFSCR","1347 Capital Corp.","0.37","n/a","2014","Finance","Business Services ","http://www.nasdaq.com/symbol/tfscr"],
10 ["TFSCU","1347 Capital Corp.","9.97","\$41.67M","2014","n/a","n/a","http://www .nasdaq.com/symbol/tfscu"], 9 ["TFSCU","1347 Capital Corp.","9.97","\$41.67M","2014","n/a","n/a","http://www .nasdaq.com/symbol/tfscu"],
11 ["TFSCW","1347 Capital Corp.","0.2","n/a","2014","Finance","Business Services" ,"http://www.nasdaq.com/symbol/tfscw"], 10 ["TFSCW","1347 Capital Corp.","0.2","n/a","2014","Finance","Business Services" ,"http://www.nasdaq.com/symbol/tfscw"],
12 ["PIH","1347 Property Insurance Holdings, Inc.","7.66","\$48.7M","2014","Finan ce","Property-Casualty Insurers","http://www.nasdaq.com/symbol/pih"], 11 ["PIH","1347 Property Insurance Holdings, Inc.","7.66","\$48.7M","2014","Finan ce","Property-Casualty Insurers","http://www.nasdaq.com/symbol/pih"],
(...skipping 2981 matching lines...) Expand 10 before | Expand all | Expand 10 after
2994 } 2993 }
2995 } 2994 }
2996 2995
2997 class StockOracle { 2996 class StockOracle {
2998 List<Stock> stocks; 2997 List<Stock> stocks;
2999 2998
3000 StockOracle(this.stocks); 2999 StockOracle(this.stocks);
3001 3000
3002 StockOracle.fromCompanyList(List<List<String>> list) { 3001 StockOracle.fromCompanyList(List<List<String>> list) {
3003 stocks = list.map((fields) => new Stock.fromFields(fields)).toList(); 3002 stocks = list.map((fields) => new Stock.fromFields(fields)).toList();
3003 stocks.sort((a, b) => a.symbol.compareTo(b.symbol));
3004 } 3004 }
3005 3005
3006 Stock lookupBySymbol(String symbol) { 3006 Stock lookupBySymbol(String symbol) {
3007 this.stocks.forEach((stock) { 3007 this.stocks.forEach((stock) {
3008 if (stock.symbol == symbol) 3008 if (stock.symbol == symbol)
3009 return stock; 3009 return stock;
3010 }); 3010 });
3011 return null; 3011 return null;
3012 } 3012 }
3013 } 3013 }
3014 3014
3015 final StockOracle oracle = new StockOracle.fromCompanyList(_kCompanyList); 3015 final StockOracle oracle = new StockOracle.fromCompanyList(_kCompanyList);
3016
3017 </script>
OLDNEW
« no previous file with comments | « sky/examples/fn/widgets/widgets.dart ('k') | sky/examples/stocks-fn/stockarrow.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698