| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 } | 308 } |
| 309 | 309 |
| 310 class StringIndexOutOfBoundsException extends JavaException { | 310 class StringIndexOutOfBoundsException extends JavaException { |
| 311 StringIndexOutOfBoundsException(int index) : super('$index'); | 311 StringIndexOutOfBoundsException(int index) : super('$index'); |
| 312 } | 312 } |
| 313 | 313 |
| 314 class IllegalStateException extends JavaException { | 314 class IllegalStateException extends JavaException { |
| 315 IllegalStateException([message = ""]) : super(message); | 315 IllegalStateException([message = ""]) : super(message); |
| 316 } | 316 } |
| 317 | 317 |
| 318 class NotImplementedException extends JavaException { |
| 319 NotImplementedException(message) : super(message); |
| 320 } |
| 321 |
| 318 class UnsupportedOperationException extends JavaException { | 322 class UnsupportedOperationException extends JavaException { |
| 319 UnsupportedOperationException([message = ""]) : super(message); | 323 UnsupportedOperationException([message = ""]) : super(message); |
| 320 } | 324 } |
| 321 | 325 |
| 322 class NoSuchElementException extends JavaException { | 326 class NoSuchElementException extends JavaException { |
| 323 String toString() => "NoSuchElementException"; | 327 String toString() => "NoSuchElementException"; |
| 324 } | 328 } |
| 325 | 329 |
| 326 class NumberFormatException extends JavaException { | 330 class NumberFormatException extends JavaException { |
| 327 String toString() => "NumberFormatException"; | 331 String toString() => "NumberFormatException"; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 javaListSet(List list, int index, newValue) { | 414 javaListSet(List list, int index, newValue) { |
| 411 var oldValue = list[index]; | 415 var oldValue = list[index]; |
| 412 list[index] = newValue; | 416 list[index] = newValue; |
| 413 return oldValue; | 417 return oldValue; |
| 414 } | 418 } |
| 415 | 419 |
| 416 bool javaCollectionContainsAll(Iterable list, Iterable c) { | 420 bool javaCollectionContainsAll(Iterable list, Iterable c) { |
| 417 return c.fold(true, (bool prev, e) => prev && list.contains(e)); | 421 return c.fold(true, (bool prev, e) => prev && list.contains(e)); |
| 418 } | 422 } |
| 419 | 423 |
| 424 bool javaSetEquals(Set a, Set b) { |
| 425 return a.containsAll(b) && b.containsAll(a); |
| 426 } |
| 427 |
| 420 javaMapPut(Map target, key, value) { | 428 javaMapPut(Map target, key, value) { |
| 421 var oldValue = target[key]; | 429 var oldValue = target[key]; |
| 422 target[key] = value; | 430 target[key] = value; |
| 423 return oldValue; | 431 return oldValue; |
| 424 } | 432 } |
| 425 | 433 |
| 426 bool javaStringEqualsIgnoreCase(String a, String b) { | 434 bool javaStringEqualsIgnoreCase(String a, String b) { |
| 427 return a.toLowerCase() == b.toLowerCase(); | 435 return a.toLowerCase() == b.toLowerCase(); |
| 428 } | 436 } |
| 429 | 437 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 * format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?' | 537 * format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?' |
| 530 */ | 538 */ |
| 531 String formatList(String pattern, List args) { | 539 String formatList(String pattern, List args) { |
| 532 return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) { | 540 return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) { |
| 533 String indexStr = match.group(1); | 541 String indexStr = match.group(1); |
| 534 int index = int.parse(indexStr); | 542 int index = int.parse(indexStr); |
| 535 var arg = args[index]; | 543 var arg = args[index]; |
| 536 return arg != null ? arg.toString() : null; | 544 return arg != null ? arg.toString() : null; |
| 537 }); | 545 }); |
| 538 } | 546 } |
| OLD | NEW |