LazilyParsedNumber.smali 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. .class public final Lcom/google/gson/internal/LazilyParsedNumber;
  2. .super Ljava/lang/Number;
  3. .source ""
  4. # instance fields
  5. .field private final value:Ljava/lang/String;
  6. # direct methods
  7. .method public constructor <init>(Ljava/lang/String;)V
  8. .locals 0
  9. invoke-direct {p0}, Ljava/lang/Number;-><init>()V
  10. iput-object p1, p0, Lcom/google/gson/internal/LazilyParsedNumber;->value:Ljava/lang/String;
  11. return-void
  12. .end method
  13. .method private writeReplace()Ljava/lang/Object;
  14. .locals 2
  15. .annotation system Ldalvik/annotation/Throws;
  16. value = {
  17. Ljava/io/ObjectStreamException;
  18. }
  19. .end annotation
  20. new-instance v0, Ljava/math/BigDecimal;
  21. iget-object v1, p0, Lcom/google/gson/internal/LazilyParsedNumber;->value:Ljava/lang/String;
  22. invoke-direct {v0, v1}, Ljava/math/BigDecimal;-><init>(Ljava/lang/String;)V
  23. return-object v0
  24. .end method
  25. # virtual methods
  26. .method public doubleValue()D
  27. .locals 2
  28. iget-object v0, p0, Lcom/google/gson/internal/LazilyParsedNumber;->value:Ljava/lang/String;
  29. invoke-static {v0}, Ljava/lang/Double;->parseDouble(Ljava/lang/String;)D
  30. move-result-wide v0
  31. return-wide v0
  32. .end method
  33. .method public equals(Ljava/lang/Object;)Z
  34. .locals 3
  35. const/4 v0, 0x1
  36. if-ne p0, p1, :cond_0
  37. return v0
  38. :cond_0
  39. instance-of v1, p1, Lcom/google/gson/internal/LazilyParsedNumber;
  40. const/4 v2, 0x0
  41. if-eqz v1, :cond_3
  42. check-cast p1, Lcom/google/gson/internal/LazilyParsedNumber;
  43. iget-object v1, p0, Lcom/google/gson/internal/LazilyParsedNumber;->value:Ljava/lang/String;
  44. iget-object p1, p1, Lcom/google/gson/internal/LazilyParsedNumber;->value:Ljava/lang/String;
  45. if-eq v1, p1, :cond_2
  46. invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
  47. move-result p1
  48. if-eqz p1, :cond_1
  49. goto :goto_0
  50. :cond_1
  51. const/4 v0, 0x0
  52. :cond_2
  53. :goto_0
  54. return v0
  55. :cond_3
  56. return v2
  57. .end method
  58. .method public floatValue()F
  59. .locals 1
  60. iget-object v0, p0, Lcom/google/gson/internal/LazilyParsedNumber;->value:Ljava/lang/String;
  61. invoke-static {v0}, Ljava/lang/Float;->parseFloat(Ljava/lang/String;)F
  62. move-result v0
  63. return v0
  64. .end method
  65. .method public hashCode()I
  66. .locals 1
  67. iget-object v0, p0, Lcom/google/gson/internal/LazilyParsedNumber;->value:Ljava/lang/String;
  68. invoke-virtual {v0}, Ljava/lang/String;->hashCode()I
  69. move-result v0
  70. return v0
  71. .end method
  72. .method public intValue()I
  73. .locals 2
  74. :try_start_0
  75. iget-object v0, p0, Lcom/google/gson/internal/LazilyParsedNumber;->value:Ljava/lang/String;
  76. invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
  77. move-result v0
  78. :try_end_0
  79. .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
  80. return v0
  81. :catch_0
  82. :try_start_1
  83. iget-object v0, p0, Lcom/google/gson/internal/LazilyParsedNumber;->value:Ljava/lang/String;
  84. invoke-static {v0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
  85. move-result-wide v0
  86. :try_end_1
  87. .catch Ljava/lang/NumberFormatException; {:try_start_1 .. :try_end_1} :catch_1
  88. long-to-int v1, v0
  89. return v1
  90. :catch_1
  91. new-instance v0, Ljava/math/BigDecimal;
  92. iget-object v1, p0, Lcom/google/gson/internal/LazilyParsedNumber;->value:Ljava/lang/String;
  93. invoke-direct {v0, v1}, Ljava/math/BigDecimal;-><init>(Ljava/lang/String;)V
  94. invoke-virtual {v0}, Ljava/math/BigDecimal;->intValue()I
  95. move-result v0
  96. return v0
  97. .end method
  98. .method public longValue()J
  99. .locals 2
  100. :try_start_0
  101. iget-object v0, p0, Lcom/google/gson/internal/LazilyParsedNumber;->value:Ljava/lang/String;
  102. invoke-static {v0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
  103. move-result-wide v0
  104. :try_end_0
  105. .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
  106. return-wide v0
  107. :catch_0
  108. new-instance v0, Ljava/math/BigDecimal;
  109. iget-object v1, p0, Lcom/google/gson/internal/LazilyParsedNumber;->value:Ljava/lang/String;
  110. invoke-direct {v0, v1}, Ljava/math/BigDecimal;-><init>(Ljava/lang/String;)V
  111. invoke-virtual {v0}, Ljava/math/BigDecimal;->longValue()J
  112. move-result-wide v0
  113. return-wide v0
  114. .end method
  115. .method public toString()Ljava/lang/String;
  116. .locals 1
  117. iget-object v0, p0, Lcom/google/gson/internal/LazilyParsedNumber;->value:Ljava/lang/String;
  118. return-object v0
  119. .end method