| 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 const int LONG_MAX_VALUE = 0x7fffffffffffffff; | 7 const int LONG_MAX_VALUE = 0x7fffffffffffffff; |
| 8 | 8 |
| 9 class JavaSystem { | 9 class JavaSystem { |
| 10 static int currentTimeMillis() { | 10 static int currentTimeMillis() { |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 end = -1]) { | 241 end = -1]) { |
| 242 if (start != 0) { | 242 if (start != 0) { |
| 243 iter = iter.skip(start); | 243 iter = iter.skip(start); |
| 244 } | 244 } |
| 245 if (end != -1) { | 245 if (end != -1) { |
| 246 iter = iter.take(end - start); | 246 iter = iter.take(end - start); |
| 247 } | 247 } |
| 248 return iter.join(separator); | 248 return iter.join(separator); |
| 249 } | 249 } |
| 250 | 250 |
| 251 static void printf(StringBuffer buffer, String fmt, List args) { |
| 252 buffer.write(_printf(fmt, args)); |
| 253 } |
| 254 |
| 251 static String remove(String str, String remove) { | 255 static String remove(String str, String remove) { |
| 252 if (isEmpty(str) || isEmpty(remove)) { | 256 if (isEmpty(str) || isEmpty(remove)) { |
| 253 return str; | 257 return str; |
| 254 } | 258 } |
| 255 return str.replaceAll(remove, ''); | 259 return str.replaceAll(remove, ''); |
| 256 } | 260 } |
| 257 | 261 |
| 258 static String removeStart(String str, String remove) { | 262 static String removeStart(String str, String remove) { |
| 259 if (isEmpty(str) || isEmpty(remove)) { | 263 if (isEmpty(str) || isEmpty(remove)) { |
| 260 return str; | 264 return str; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 276 static List<String> split(String s, [String pattern = ' ']) { | 280 static List<String> split(String s, [String pattern = ' ']) { |
| 277 return s.split(pattern); | 281 return s.split(pattern); |
| 278 } | 282 } |
| 279 | 283 |
| 280 static List<String> splitByWholeSeparatorPreserveAllTokens(String s, String | 284 static List<String> splitByWholeSeparatorPreserveAllTokens(String s, String |
| 281 pattern) { | 285 pattern) { |
| 282 return s.split(pattern); | 286 return s.split(pattern); |
| 283 } | 287 } |
| 284 } | 288 } |
| 285 | 289 |
| 286 class Math { | |
| 287 static num max(num a, num b) => math.max(a, b); | |
| 288 static num min(num a, num b) => math.min(a, b); | |
| 289 } | |
| 290 | |
| 291 class RuntimeException extends JavaException { | 290 class RuntimeException extends JavaException { |
| 292 RuntimeException({String message: "", Exception cause: null}) : | 291 RuntimeException({String message: "", Exception cause: null}) : |
| 293 super(message, cause); | 292 super(message, cause); |
| 294 } | 293 } |
| 295 | 294 |
| 296 class JavaException implements Exception { | 295 class JavaException implements Exception { |
| 297 final String message; | 296 final String message; |
| 298 final Exception cause; | 297 final Exception cause; |
| 299 JavaException([this.message = "", this.cause = null]); | 298 JavaException([this.message = "", this.cause = null]); |
| 300 JavaException.withCause(this.cause) : message = null; | 299 JavaException.withCause(this.cause) : message = null; |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 * format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?' | 515 * format('{0} are you {1}ing?', ['What', 'read']) = 'What are you reading?' |
| 517 */ | 516 */ |
| 518 String formatList(String pattern, List args) { | 517 String formatList(String pattern, List args) { |
| 519 return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) { | 518 return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) { |
| 520 String indexStr = match.group(1); | 519 String indexStr = match.group(1); |
| 521 int index = int.parse(indexStr); | 520 int index = int.parse(indexStr); |
| 522 var arg = args[index]; | 521 var arg = args[index]; |
| 523 return arg != null ? arg.toString() : null; | 522 return arg != null ? arg.toString() : null; |
| 524 }); | 523 }); |
| 525 } | 524 } |
| OLD | NEW |