OLD | NEW |
1 library java.core; | 1 library java.core; |
2 | 2 |
3 import "dart:math" as math; | 3 import "dart:math" as math; |
4 | 4 |
5 final Stopwatch nanoTimeStopwatch = new Stopwatch(); | 5 final Stopwatch nanoTimeStopwatch = new Stopwatch(); |
6 | 6 |
7 class JavaSystem { | 7 class JavaSystem { |
8 static int currentTimeMillis() { | 8 static int currentTimeMillis() { |
9 return (new DateTime.now()).millisecondsSinceEpoch; | 9 return (new DateTime.now()).millisecondsSinceEpoch; |
10 } | 10 } |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 final StringBuffer _sb = new StringBuffer(); | 277 final StringBuffer _sb = new StringBuffer(); |
278 | 278 |
279 void print(x) { | 279 void print(x) { |
280 _sb.write(x); | 280 _sb.write(x); |
281 } | 281 } |
282 | 282 |
283 String toString() => _sb.toString(); | 283 String toString() => _sb.toString(); |
284 } | 284 } |
285 | 285 |
286 class StringUtils { | 286 class StringUtils { |
287 static List<String> split(String s, String pattern) => s.split(pattern); | 287 static List<String> split(String s, [String pattern = '']) => s.split(pattern)
; |
288 static String replace(String s, String from, String to) => s.replaceAll(from,
to); | 288 static String replace(String s, String from, String to) => s.replaceAll(from,
to); |
289 static String repeat(String s, int n) { | 289 static String repeat(String s, int n) { |
290 StringBuffer sb = new StringBuffer(); | 290 StringBuffer sb = new StringBuffer(); |
291 for (int i = 0; i < n; i++) { | 291 for (int i = 0; i < n; i++) { |
292 sb.write(s); | 292 sb.write(s); |
293 } | 293 } |
294 return sb.toString(); | 294 return sb.toString(); |
295 } | 295 } |
296 } | 296 } |
297 | 297 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 if (!_matches.moveNext()) { | 506 if (!_matches.moveNext()) { |
507 return false; | 507 return false; |
508 } | 508 } |
509 _match = _matches.current; | 509 _match = _matches.current; |
510 return true; | 510 return true; |
511 } | 511 } |
512 String group(int i) => _match[i]; | 512 String group(int i) => _match[i]; |
513 int start() => _match.start; | 513 int start() => _match.start; |
514 int end() => _match.end; | 514 int end() => _match.end; |
515 } | 515 } |
OLD | NEW |