OLD | NEW |
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 import 'dart:isolate'; | 5 import 'dart:isolate'; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 | 7 |
8 class Fields { | 8 class Fields { |
9 Fields(int i, int j) : fld1 = i, fld2 = j, fld5 = true {} | 9 Fields(int i, int j) : fld1 = i, fld2 = j, fld5 = true {} |
10 int fld1; | 10 int fld1; |
(...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1476 void _validateResult() { | 1476 void _validateResult() { |
1477 // TODO(ngeoffray): Implement this. | 1477 // TODO(ngeoffray): Implement this. |
1478 _validated.complete(true); | 1478 _validated.complete(true); |
1479 } | 1479 } |
1480 | 1480 |
1481 void _printResult() { | 1481 void _printResult() { |
1482 var output = new StringBuffer(); | 1482 var output = new StringBuffer(); |
1483 for (int i = 0; i < _result.length; i++) { | 1483 for (int i = 0; i < _result.length; i++) { |
1484 List<int> line = _result[i]; | 1484 List<int> line = _result[i]; |
1485 for (int j = 0; j < line.length; j++) { | 1485 for (int j = 0; j < line.length; j++) { |
1486 if (line[j] < 10) output.add("0"); | 1486 if (line[j] < 10) output.write("0"); |
1487 output.add(line[j]); | 1487 output.write(line[j]); |
1488 } | 1488 } |
1489 output.add("\n"); | 1489 output.write("\n"); |
1490 } | 1490 } |
1491 // print(output); | 1491 // print(output); |
1492 } | 1492 } |
1493 | 1493 |
1494 List<List<int>> _result; | 1494 List<List<int>> _result; |
1495 List<LineProcessorClient> _lineProcessedBy; | 1495 List<LineProcessorClient> _lineProcessedBy; |
1496 int _sent; | 1496 int _sent; |
1497 int _missing; | 1497 int _missing; |
1498 Completer<bool> _validated; | 1498 Completer<bool> _validated; |
1499 } | 1499 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1550 void processLines() { | 1550 void processLines() { |
1551 port.receive((message, SendPort replyTo) { | 1551 port.receive((message, SendPort replyTo) { |
1552 if (message == TERMINATION_MESSAGE) { | 1552 if (message == TERMINATION_MESSAGE) { |
1553 assert(replyTo == null); | 1553 assert(replyTo == null); |
1554 port.close(); | 1554 port.close(); |
1555 } else { | 1555 } else { |
1556 replyTo.send(processLine(message), null); | 1556 replyTo.send(processLine(message), null); |
1557 } | 1557 } |
1558 }); | 1558 }); |
1559 } | 1559 } |
OLD | NEW |