LinkedHashTreeMap$AvlBuilder.smali 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. .class final Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingClass;
  6. value = Lcom/google/gson/internal/LinkedHashTreeMap;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x18
  10. name = "AvlBuilder"
  11. .end annotation
  12. .annotation system Ldalvik/annotation/Signature;
  13. value = {
  14. "<K:",
  15. "Ljava/lang/Object;",
  16. "V:",
  17. "Ljava/lang/Object;",
  18. ">",
  19. "Ljava/lang/Object;"
  20. }
  21. .end annotation
  22. # instance fields
  23. .field private leavesSkipped:I
  24. .field private leavesToSkip:I
  25. .field private size:I
  26. .field private stack:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  27. .annotation system Ldalvik/annotation/Signature;
  28. value = {
  29. "Lcom/google/gson/internal/LinkedHashTreeMap$Node<",
  30. "TK;TV;>;"
  31. }
  32. .end annotation
  33. .end field
  34. # direct methods
  35. .method constructor <init>()V
  36. .locals 0
  37. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  38. return-void
  39. .end method
  40. # virtual methods
  41. .method add(Lcom/google/gson/internal/LinkedHashTreeMap$Node;)V
  42. .locals 5
  43. .annotation system Ldalvik/annotation/Signature;
  44. value = {
  45. "(",
  46. "Lcom/google/gson/internal/LinkedHashTreeMap$Node<",
  47. "TK;TV;>;)V"
  48. }
  49. .end annotation
  50. const/4 v0, 0x0
  51. iput-object v0, p1, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->right:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  52. iput-object v0, p1, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->parent:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  53. iput-object v0, p1, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->left:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  54. const/4 v0, 0x1
  55. iput v0, p1, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->height:I
  56. iget v1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->leavesToSkip:I
  57. if-lez v1, :cond_0
  58. iget v2, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->size:I
  59. and-int/lit8 v3, v2, 0x1
  60. if-nez v3, :cond_0
  61. add-int/2addr v2, v0
  62. iput v2, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->size:I
  63. sub-int/2addr v1, v0
  64. iput v1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->leavesToSkip:I
  65. iget v1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->leavesSkipped:I
  66. add-int/2addr v1, v0
  67. iput v1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->leavesSkipped:I
  68. :cond_0
  69. iget-object v1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->stack:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  70. iput-object v1, p1, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->parent:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  71. iput-object p1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->stack:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  72. iget p1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->size:I
  73. add-int/2addr p1, v0
  74. iput p1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->size:I
  75. iget p1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->leavesToSkip:I
  76. if-lez p1, :cond_1
  77. iget v1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->size:I
  78. and-int/lit8 v2, v1, 0x1
  79. if-nez v2, :cond_1
  80. add-int/2addr v1, v0
  81. iput v1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->size:I
  82. sub-int/2addr p1, v0
  83. iput p1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->leavesToSkip:I
  84. iget p1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->leavesSkipped:I
  85. add-int/2addr p1, v0
  86. iput p1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->leavesSkipped:I
  87. :cond_1
  88. const/4 p1, 0x4
  89. :goto_0
  90. iget v1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->size:I
  91. add-int/lit8 v2, p1, -0x1
  92. and-int/2addr v1, v2
  93. if-ne v1, v2, :cond_5
  94. iget v1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->leavesSkipped:I
  95. if-nez v1, :cond_2
  96. iget-object v1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->stack:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  97. iget-object v2, v1, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->parent:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  98. iget-object v3, v2, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->parent:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  99. iget-object v4, v3, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->parent:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  100. iput-object v4, v2, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->parent:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  101. iput-object v2, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->stack:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  102. iput-object v3, v2, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->left:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  103. iput-object v1, v2, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->right:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  104. iget v4, v1, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->height:I
  105. add-int/2addr v4, v0
  106. iput v4, v2, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->height:I
  107. iput-object v2, v3, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->parent:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  108. iput-object v2, v1, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->parent:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  109. goto :goto_2
  110. :cond_2
  111. const/4 v2, 0x0
  112. if-ne v1, v0, :cond_3
  113. iget-object v1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->stack:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  114. iget-object v3, v1, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->parent:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  115. iput-object v3, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->stack:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  116. iput-object v1, v3, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->right:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  117. iget v4, v1, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->height:I
  118. add-int/2addr v4, v0
  119. iput v4, v3, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->height:I
  120. iput-object v3, v1, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->parent:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  121. :goto_1
  122. iput v2, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->leavesSkipped:I
  123. goto :goto_2
  124. :cond_3
  125. const/4 v3, 0x2
  126. if-ne v1, v3, :cond_4
  127. goto :goto_1
  128. :cond_4
  129. :goto_2
  130. mul-int/lit8 p1, p1, 0x2
  131. goto :goto_0
  132. :cond_5
  133. return-void
  134. .end method
  135. .method reset(I)V
  136. .locals 1
  137. invoke-static {p1}, Ljava/lang/Integer;->highestOneBit(I)I
  138. move-result v0
  139. mul-int/lit8 v0, v0, 0x2
  140. add-int/lit8 v0, v0, -0x1
  141. sub-int/2addr v0, p1
  142. iput v0, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->leavesToSkip:I
  143. const/4 p1, 0x0
  144. iput p1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->size:I
  145. iput p1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->leavesSkipped:I
  146. const/4 p1, 0x0
  147. iput-object p1, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->stack:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  148. return-void
  149. .end method
  150. .method root()Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  151. .locals 2
  152. .annotation system Ldalvik/annotation/Signature;
  153. value = {
  154. "()",
  155. "Lcom/google/gson/internal/LinkedHashTreeMap$Node<",
  156. "TK;TV;>;"
  157. }
  158. .end annotation
  159. iget-object v0, p0, Lcom/google/gson/internal/LinkedHashTreeMap$AvlBuilder;->stack:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  160. iget-object v1, v0, Lcom/google/gson/internal/LinkedHashTreeMap$Node;->parent:Lcom/google/gson/internal/LinkedHashTreeMap$Node;
  161. if-nez v1, :cond_0
  162. return-object v0
  163. :cond_0
  164. new-instance v0, Ljava/lang/IllegalStateException;
  165. invoke-direct {v0}, Ljava/lang/IllegalStateException;-><init>()V
  166. throw v0
  167. .end method