RouteSelector$Selection.smali 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. .class public final Lokhttp3/internal/connection/RouteSelector$Selection;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingClass;
  6. value = Lokhttp3/internal/connection/RouteSelector;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x19
  10. name = "Selection"
  11. .end annotation
  12. # instance fields
  13. .field private nextRouteIndex:I
  14. .field private final routes:Ljava/util/List;
  15. .annotation system Ldalvik/annotation/Signature;
  16. value = {
  17. "Ljava/util/List<",
  18. "Lokhttp3/Route;",
  19. ">;"
  20. }
  21. .end annotation
  22. .end field
  23. # direct methods
  24. .method constructor <init>(Ljava/util/List;)V
  25. .locals 1
  26. .annotation system Ldalvik/annotation/Signature;
  27. value = {
  28. "(",
  29. "Ljava/util/List<",
  30. "Lokhttp3/Route;",
  31. ">;)V"
  32. }
  33. .end annotation
  34. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  35. const/4 v0, 0x0
  36. iput v0, p0, Lokhttp3/internal/connection/RouteSelector$Selection;->nextRouteIndex:I
  37. iput-object p1, p0, Lokhttp3/internal/connection/RouteSelector$Selection;->routes:Ljava/util/List;
  38. return-void
  39. .end method
  40. # virtual methods
  41. .method public getAll()Ljava/util/List;
  42. .locals 2
  43. .annotation system Ldalvik/annotation/Signature;
  44. value = {
  45. "()",
  46. "Ljava/util/List<",
  47. "Lokhttp3/Route;",
  48. ">;"
  49. }
  50. .end annotation
  51. new-instance v0, Ljava/util/ArrayList;
  52. iget-object v1, p0, Lokhttp3/internal/connection/RouteSelector$Selection;->routes:Ljava/util/List;
  53. invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
  54. return-object v0
  55. .end method
  56. .method public hasNext()Z
  57. .locals 2
  58. iget v0, p0, Lokhttp3/internal/connection/RouteSelector$Selection;->nextRouteIndex:I
  59. iget-object v1, p0, Lokhttp3/internal/connection/RouteSelector$Selection;->routes:Ljava/util/List;
  60. invoke-interface {v1}, Ljava/util/List;->size()I
  61. move-result v1
  62. if-ge v0, v1, :cond_0
  63. const/4 v0, 0x1
  64. goto :goto_0
  65. :cond_0
  66. const/4 v0, 0x0
  67. :goto_0
  68. return v0
  69. .end method
  70. .method public next()Lokhttp3/Route;
  71. .locals 3
  72. invoke-virtual {p0}, Lokhttp3/internal/connection/RouteSelector$Selection;->hasNext()Z
  73. move-result v0
  74. if-eqz v0, :cond_0
  75. iget-object v0, p0, Lokhttp3/internal/connection/RouteSelector$Selection;->routes:Ljava/util/List;
  76. iget v1, p0, Lokhttp3/internal/connection/RouteSelector$Selection;->nextRouteIndex:I
  77. add-int/lit8 v2, v1, 0x1
  78. iput v2, p0, Lokhttp3/internal/connection/RouteSelector$Selection;->nextRouteIndex:I
  79. invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
  80. move-result-object v0
  81. check-cast v0, Lokhttp3/Route;
  82. return-object v0
  83. :cond_0
  84. new-instance v0, Ljava/util/NoSuchElementException;
  85. invoke-direct {v0}, Ljava/util/NoSuchElementException;-><init>()V
  86. throw v0
  87. .end method