| 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 import "dart:collection" show ListBase; | 4 import "dart:collection" show ListBase; |
| 5 | 5 |
| 6 class JavaSystem { | 6 class JavaSystem { |
| 7 static int currentTimeMillis() { | 7 static int currentTimeMillis() { |
| 8 return (new DateTime.now()).millisecondsSinceEpoch; | 8 return (new DateTime.now()).millisecondsSinceEpoch; |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 final Exception cause; | 281 final Exception cause; |
| 282 JavaException([this.message = "", this.cause = null]); | 282 JavaException([this.message = "", this.cause = null]); |
| 283 JavaException.withCause(this.cause) : message = null; | 283 JavaException.withCause(this.cause) : message = null; |
| 284 String toString() => "${runtimeType}: $message $cause"; | 284 String toString() => "${runtimeType}: $message $cause"; |
| 285 } | 285 } |
| 286 | 286 |
| 287 class JavaIOException extends JavaException { | 287 class JavaIOException extends JavaException { |
| 288 JavaIOException([message = "", cause = null]) : super(message, cause); | 288 JavaIOException([message = "", cause = null]) : super(message, cause); |
| 289 } | 289 } |
| 290 | 290 |
| 291 class IllegalArgumentException implements Exception { | 291 class IllegalArgumentException extends JavaException { |
| 292 final String message; | 292 IllegalArgumentException([message = "", cause = null]) : super(message, cause)
; |
| 293 const IllegalArgumentException([this.message = "", Exception e = null]); | |
| 294 String toString() => "IllegalStateException: $message"; | |
| 295 } | 293 } |
| 296 | 294 |
| 297 class StringIndexOutOfBoundsException implements Exception { | 295 class StringIndexOutOfBoundsException extends JavaException { |
| 298 final int index; | 296 StringIndexOutOfBoundsException(int index) : super('$index'); |
| 299 const StringIndexOutOfBoundsException(this.index); | |
| 300 String toString() => "StringIndexOutOfBoundsException: $index"; | |
| 301 } | 297 } |
| 302 | 298 |
| 303 class IllegalStateException implements Exception { | 299 class IllegalStateException extends JavaException { |
| 304 final String message; | 300 IllegalStateException([message = ""]) : super(message); |
| 305 const IllegalStateException([this.message = ""]); | |
| 306 String toString() => "IllegalStateException: $message"; | |
| 307 } | 301 } |
| 308 | 302 |
| 309 class UnsupportedOperationException implements Exception { | 303 class UnsupportedOperationException extends JavaException { |
| 310 String toString() => "UnsupportedOperationException"; | 304 String toString() => "UnsupportedOperationException"; |
| 311 } | 305 } |
| 312 | 306 |
| 313 class NumberFormatException implements Exception { | 307 class NumberFormatException extends JavaException { |
| 314 String toString() => "NumberFormatException"; | 308 String toString() => "NumberFormatException"; |
| 315 } | 309 } |
| 316 | 310 |
| 317 /// Parses given string to [Uri], throws [URISyntaxException] if invalid. | 311 /// Parses given string to [Uri], throws [URISyntaxException] if invalid. |
| 318 Uri parseUriWithException(String str) { | 312 Uri parseUriWithException(String str) { |
| 319 Uri uri = Uri.parse(str); | 313 Uri uri = Uri.parse(str); |
| 320 if (uri.path.isEmpty) { | 314 if (uri.path.isEmpty) { |
| 321 throw new URISyntaxException(); | 315 throw new URISyntaxException(); |
| 322 } | 316 } |
| 323 return uri; | 317 return uri; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 } | 363 } |
| 370 | 364 |
| 371 void setAll(int index, Iterable<E> iterable) { | 365 void setAll(int index, Iterable<E> iterable) { |
| 372 elements.setAll(index, iterable); | 366 elements.setAll(index, iterable); |
| 373 } | 367 } |
| 374 | 368 |
| 375 void sort([int compare(E a, E b)]) { | 369 void sort([int compare(E a, E b)]) { |
| 376 elements.sort(compare); | 370 elements.sort(compare); |
| 377 } | 371 } |
| 378 | 372 |
| 379 void shuffle() { | |
| 380 elements.shuffle(); | |
| 381 } | |
| 382 | |
| 383 int indexOf(E element, [int start = 0]) { | 373 int indexOf(E element, [int start = 0]) { |
| 384 return elements.indexOf(element, start); | 374 return elements.indexOf(element, start); |
| 385 } | 375 } |
| 386 | 376 |
| 387 void insert(int index, E element) { | 377 void insert(int index, E element) { |
| 388 elements.insert(index, element); | 378 elements.insert(index, element); |
| 389 } | 379 } |
| 390 | 380 |
| 391 void insertAll(int index, Iterable<E> iterable) { | 381 void insertAll(int index, Iterable<E> iterable) { |
| 392 elements.insertAll(index, iterable); | 382 elements.insertAll(index, iterable); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 if (!_matches.moveNext()) { | 571 if (!_matches.moveNext()) { |
| 582 return false; | 572 return false; |
| 583 } | 573 } |
| 584 _match = _matches.current; | 574 _match = _matches.current; |
| 585 return true; | 575 return true; |
| 586 } | 576 } |
| 587 String group(int i) => _match[i]; | 577 String group(int i) => _match[i]; |
| 588 int start() => _match.start; | 578 int start() => _match.start; |
| 589 int end() => _match.end; | 579 int end() => _match.end; |
| 590 } | 580 } |
| OLD | NEW |