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 13 matching lines...) Expand all Loading... |
24 return false; | 24 return false; |
25 } | 25 } |
26 if (o.runtimeType == t) { | 26 if (o.runtimeType == t) { |
27 return true; | 27 return true; |
28 } | 28 } |
29 String oTypeName = o.runtimeType.toString(); | 29 String oTypeName = o.runtimeType.toString(); |
30 String tTypeName = t.toString(); | 30 String tTypeName = t.toString(); |
31 if (oTypeName == tTypeName) { | 31 if (oTypeName == tTypeName) { |
32 return true; | 32 return true; |
33 } | 33 } |
34 if (oTypeName.startsWith("HashMap") && tTypeName == "Map") { | |
35 return true; | |
36 } | |
37 if (oTypeName.startsWith("LinkedHashMap") && tTypeName == "Map") { | |
38 return true; | |
39 } | |
40 if (oTypeName.startsWith("List") && tTypeName == "List") { | 34 if (oTypeName.startsWith("List") && tTypeName == "List") { |
41 return true; | 35 return true; |
42 } | 36 } |
| 37 if (tTypeName == "Map" && o is Map) { |
| 38 return true; |
| 39 } |
43 // Dart Analysis Engine specific | 40 // Dart Analysis Engine specific |
44 if (oTypeName == "${tTypeName}Impl") { | 41 if (oTypeName == "${tTypeName}Impl") { |
45 return true; | 42 return true; |
46 } | 43 } |
47 if (tTypeName == "MethodElement") { | 44 if (tTypeName == "MethodElement") { |
48 if (oTypeName == "MethodMember") { | 45 if (oTypeName == "MethodMember") { |
49 return true; | 46 return true; |
50 } | 47 } |
51 } | 48 } |
52 if (tTypeName == "ExecutableElement") { | 49 if (tTypeName == "ExecutableElement") { |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 abstract class Enum<E extends Enum> implements Comparable<E> { | 555 abstract class Enum<E extends Enum> implements Comparable<E> { |
559 /// The name of this enum constant, as declared in the enum declaration. | 556 /// The name of this enum constant, as declared in the enum declaration. |
560 final String name; | 557 final String name; |
561 /// The position in the enum declaration. | 558 /// The position in the enum declaration. |
562 final int ordinal; | 559 final int ordinal; |
563 Enum(this.name, this.ordinal); | 560 Enum(this.name, this.ordinal); |
564 int get hashCode => ordinal; | 561 int get hashCode => ordinal; |
565 String toString() => name; | 562 String toString() => name; |
566 int compareTo(E other) => ordinal - other.ordinal; | 563 int compareTo(E other) => ordinal - other.ordinal; |
567 } | 564 } |
OLD | NEW |