| 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 class JavaSystem { | 5 class JavaSystem { |
| 6 static int currentTimeMillis() { | 6 static int currentTimeMillis() { |
| 7 return (new DateTime.now()).millisecondsSinceEpoch; | 7 return (new DateTime.now()).millisecondsSinceEpoch; |
| 8 } | 8 } |
| 9 | 9 |
| 10 static void arraycopy(List src, int srcPos, List dest, int destPos, int length
) { | 10 static void arraycopy(List src, int srcPos, List dest, int destPos, int length
) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 oTypeName == "ConstTopLevelVariableElementImpl") { | 75 oTypeName == "ConstTopLevelVariableElementImpl") { |
| 76 return true; | 76 return true; |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 // no | 79 // no |
| 80 return false; | 80 return false; |
| 81 } | 81 } |
| 82 | 82 |
| 83 class JavaArrays { | 83 class JavaArrays { |
| 84 static bool equals(List a, List b) { | 84 static bool equals(List a, List b) { |
| 85 if (identical(a, b)) { |
| 86 return true; |
| 87 } |
| 85 if (a.length != b.length) { | 88 if (a.length != b.length) { |
| 86 return false; | 89 return false; |
| 87 } | 90 } |
| 88 var len = a.length; | 91 var len = a.length; |
| 89 for (int i = 0; i < len; i++) { | 92 for (int i = 0; i < len; i++) { |
| 90 if (a[i] != b[i]) { | 93 if (a[i] != b[i]) { |
| 91 return false; | 94 return false; |
| 92 } | 95 } |
| 93 } | 96 } |
| 94 return true; | 97 return true; |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 }); | 397 }); |
| 395 return result; | 398 return result; |
| 396 } | 399 } |
| 397 | 400 |
| 398 javaListSet(List list, int index, newValue) { | 401 javaListSet(List list, int index, newValue) { |
| 399 var oldValue = list[index]; | 402 var oldValue = list[index]; |
| 400 list[index] = newValue; | 403 list[index] = newValue; |
| 401 return oldValue; | 404 return oldValue; |
| 402 } | 405 } |
| 403 | 406 |
| 404 bool javaSetAdd(Set s, o) { | |
| 405 if (!s.contains(o)) { | |
| 406 s.add(o); | |
| 407 return true; | |
| 408 } | |
| 409 return false; | |
| 410 } | |
| 411 | |
| 412 bool javaCollectionContainsAll(Iterable list, Iterable c) { | 407 bool javaCollectionContainsAll(Iterable list, Iterable c) { |
| 413 return c.fold(true, (bool prev, e) => prev && list.contains(e)); | 408 return c.fold(true, (bool prev, e) => prev && list.contains(e)); |
| 414 } | 409 } |
| 415 | 410 |
| 416 javaMapPut(Map target, key, value) { | 411 javaMapPut(Map target, key, value) { |
| 417 var oldValue = target[key]; | 412 var oldValue = target[key]; |
| 418 target[key] = value; | 413 target[key] = value; |
| 419 return oldValue; | 414 return oldValue; |
| 420 } | 415 } |
| 421 | 416 |
| 422 void javaMapPutAll(Map target, Map source) { | |
| 423 source.forEach((k, v) { | |
| 424 target[k] = v; | |
| 425 }); | |
| 426 } | |
| 427 | |
| 428 bool javaStringEqualsIgnoreCase(String a, String b) { | 417 bool javaStringEqualsIgnoreCase(String a, String b) { |
| 429 return a.toLowerCase() == b.toLowerCase(); | 418 return a.toLowerCase() == b.toLowerCase(); |
| 430 } | 419 } |
| 431 | 420 |
| 432 bool javaStringRegionMatches(String t, int toffset, String o, int ooffset, int l
en) { | 421 bool javaStringRegionMatches(String t, int toffset, String o, int ooffset, int l
en) { |
| 433 if (toffset < 0) return false; | 422 if (toffset < 0) return false; |
| 434 if (ooffset < 0) return false; | 423 if (ooffset < 0) return false; |
| 435 var tend = toffset + len; | 424 var tend = toffset + len; |
| 436 var oend = ooffset + len; | 425 var oend = ooffset + len; |
| 437 if (tend > t.length) return false; | 426 if (tend > t.length) return false; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 if (!_matches.moveNext()) { | 487 if (!_matches.moveNext()) { |
| 499 return false; | 488 return false; |
| 500 } | 489 } |
| 501 _match = _matches.current; | 490 _match = _matches.current; |
| 502 return true; | 491 return true; |
| 503 } | 492 } |
| 504 String group(int i) => _match[i]; | 493 String group(int i) => _match[i]; |
| 505 int start() => _match.start; | 494 int start() => _match.start; |
| 506 int end() => _match.end; | 495 int end() => _match.end; |
| 507 } | 496 } |
| OLD | NEW |