123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522 |
- .class final Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;
- .super Ljava/util/concurrent/atomic/AtomicReference;
- .source "ReplaySubject.java"
- # interfaces
- .implements Lio/reactivex/subjects/ReplaySubject$ReplayBuffer;
- # annotations
- .annotation system Ldalvik/annotation/EnclosingClass;
- value = Lio/reactivex/subjects/ReplaySubject;
- .end annotation
- .annotation system Ldalvik/annotation/InnerClass;
- accessFlags = 0x18
- name = "UnboundedReplayBuffer"
- .end annotation
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- ">",
- "Ljava/util/concurrent/atomic/AtomicReference<",
- "Ljava/lang/Object;",
- ">;",
- "Lio/reactivex/subjects/ReplaySubject$ReplayBuffer<",
- "TT;>;"
- }
- .end annotation
- # static fields
- .field private static final serialVersionUID:J = -0xa2f4068c73be4b3L
- # instance fields
- .field final buffer:Ljava/util/List;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Ljava/util/List<",
- "Ljava/lang/Object;",
- ">;"
- }
- .end annotation
- .end field
- .field volatile done:Z
- .field volatile size:I
- # direct methods
- .method constructor <init>(I)V
- .locals 2
- .line 529
- invoke-direct {p0}, Ljava/util/concurrent/atomic/AtomicReference;-><init>()V
- .line 530
- new-instance v0, Ljava/util/ArrayList;
- const-string v1, "capacityHint"
- invoke-static {p1, v1}, Lio/reactivex/internal/functions/ObjectHelper;->verifyPositive(ILjava/lang/String;)I
- move-result p1
- invoke-direct {v0, p1}, Ljava/util/ArrayList;-><init>(I)V
- iput-object v0, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->buffer:Ljava/util/List;
- return-void
- .end method
- # virtual methods
- .method public add(Ljava/lang/Object;)V
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(TT;)V"
- }
- .end annotation
- .line 535
- iget-object v0, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->buffer:Ljava/util/List;
- invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
- .line 536
- iget p1, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->size:I
- add-int/lit8 p1, p1, 0x1
- iput p1, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->size:I
- return-void
- .end method
- .method public addFinal(Ljava/lang/Object;)V
- .locals 1
- .line 541
- iget-object v0, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->buffer:Ljava/util/List;
- invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
- .line 542
- iget p1, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->size:I
- const/4 v0, 0x1
- add-int/2addr p1, v0
- iput p1, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->size:I
- .line 543
- iput-boolean v0, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->done:Z
- return-void
- .end method
- .method public getValue()Ljava/lang/Object;
- .locals 5
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "()TT;"
- }
- .end annotation
- .line 549
- iget v0, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->size:I
- const/4 v1, 0x0
- if-eqz v0, :cond_3
- .line 551
- iget-object v2, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->buffer:Ljava/util/List;
- add-int/lit8 v3, v0, -0x1
- .line 552
- invoke-interface {v2, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object v3
- .line 553
- invoke-static {v3}, Lio/reactivex/internal/util/NotificationLite;->isComplete(Ljava/lang/Object;)Z
- move-result v4
- if-nez v4, :cond_1
- invoke-static {v3}, Lio/reactivex/internal/util/NotificationLite;->isError(Ljava/lang/Object;)Z
- move-result v4
- if-eqz v4, :cond_0
- goto :goto_0
- :cond_0
- return-object v3
- :cond_1
- :goto_0
- const/4 v3, 0x1
- if-ne v0, v3, :cond_2
- return-object v1
- :cond_2
- add-int/lit8 v0, v0, -0x2
- .line 557
- invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object v0
- return-object v0
- :cond_3
- return-object v1
- .end method
- .method public getValues([Ljava/lang/Object;)[Ljava/lang/Object;
- .locals 6
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "([TT;)[TT;"
- }
- .end annotation
- .line 567
- iget v0, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->size:I
- const/4 v1, 0x0
- const/4 v2, 0x0
- if-nez v0, :cond_1
- .line 569
- array-length v0, p1
- if-eqz v0, :cond_0
- .line 570
- aput-object v1, p1, v2
- :cond_0
- return-object p1
- .line 574
- :cond_1
- iget-object v3, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->buffer:Ljava/util/List;
- add-int/lit8 v4, v0, -0x1
- .line 575
- invoke-interface {v3, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object v4
- .line 577
- invoke-static {v4}, Lio/reactivex/internal/util/NotificationLite;->isComplete(Ljava/lang/Object;)Z
- move-result v5
- if-nez v5, :cond_2
- invoke-static {v4}, Lio/reactivex/internal/util/NotificationLite;->isError(Ljava/lang/Object;)Z
- move-result v4
- if-eqz v4, :cond_4
- :cond_2
- add-int/lit8 v0, v0, -0x1
- if-nez v0, :cond_4
- .line 580
- array-length v0, p1
- if-eqz v0, :cond_3
- .line 581
- aput-object v1, p1, v2
- :cond_3
- return-object p1
- .line 588
- :cond_4
- array-length v4, p1
- if-ge v4, v0, :cond_5
- .line 589
- invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
- move-result-object p1
- invoke-virtual {p1}, Ljava/lang/Class;->getComponentType()Ljava/lang/Class;
- move-result-object p1
- invoke-static {p1, v0}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;I)Ljava/lang/Object;
- move-result-object p1
- check-cast p1, [Ljava/lang/Object;
- check-cast p1, [Ljava/lang/Object;
- :cond_5
- :goto_0
- if-ge v2, v0, :cond_6
- .line 592
- invoke-interface {v3, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object v4
- aput-object v4, p1, v2
- add-int/lit8 v2, v2, 0x1
- goto :goto_0
- .line 594
- :cond_6
- array-length v2, p1
- if-le v2, v0, :cond_7
- .line 595
- aput-object v1, p1, v0
- :cond_7
- return-object p1
- .end method
- .method public replay(Lio/reactivex/subjects/ReplaySubject$ReplayDisposable;)V
- .locals 9
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Lio/reactivex/subjects/ReplaySubject$ReplayDisposable<",
- "TT;>;)V"
- }
- .end annotation
- .line 604
- invoke-virtual {p1}, Lio/reactivex/subjects/ReplaySubject$ReplayDisposable;->getAndIncrement()I
- move-result v0
- if-eqz v0, :cond_0
- return-void
- .line 609
- :cond_0
- iget-object v0, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->buffer:Ljava/util/List;
- .line 610
- iget-object v1, p1, Lio/reactivex/subjects/ReplaySubject$ReplayDisposable;->actual:Lio/reactivex/Observer;
- .line 612
- iget-object v2, p1, Lio/reactivex/subjects/ReplaySubject$ReplayDisposable;->index:Ljava/lang/Object;
- check-cast v2, Ljava/lang/Integer;
- const/4 v3, 0x0
- const/4 v4, 0x1
- if-eqz v2, :cond_1
- .line 615
- invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I
- move-result v3
- goto :goto_0
- .line 618
- :cond_1
- invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object v2
- iput-object v2, p1, Lio/reactivex/subjects/ReplaySubject$ReplayDisposable;->index:Ljava/lang/Object;
- :goto_0
- const/4 v2, 0x1
- .line 623
- :cond_2
- :goto_1
- iget-boolean v5, p1, Lio/reactivex/subjects/ReplaySubject$ReplayDisposable;->cancelled:Z
- const/4 v6, 0x0
- if-eqz v5, :cond_3
- .line 624
- iput-object v6, p1, Lio/reactivex/subjects/ReplaySubject$ReplayDisposable;->index:Ljava/lang/Object;
- return-void
- .line 628
- :cond_3
- iget v5, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->size:I
- :goto_2
- if-eq v5, v3, :cond_7
- .line 632
- iget-boolean v7, p1, Lio/reactivex/subjects/ReplaySubject$ReplayDisposable;->cancelled:Z
- if-eqz v7, :cond_4
- .line 633
- iput-object v6, p1, Lio/reactivex/subjects/ReplaySubject$ReplayDisposable;->index:Ljava/lang/Object;
- return-void
- .line 637
- :cond_4
- invoke-interface {v0, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object v7
- .line 639
- iget-boolean v8, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->done:Z
- if-eqz v8, :cond_6
- add-int/lit8 v8, v3, 0x1
- if-ne v8, v5, :cond_6
- .line 641
- iget v5, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->size:I
- if-ne v8, v5, :cond_6
- .line 643
- invoke-static {v7}, Lio/reactivex/internal/util/NotificationLite;->isComplete(Ljava/lang/Object;)Z
- move-result v0
- if-eqz v0, :cond_5
- .line 644
- invoke-interface {v1}, Lio/reactivex/Observer;->onComplete()V
- goto :goto_3
- .line 646
- :cond_5
- invoke-static {v7}, Lio/reactivex/internal/util/NotificationLite;->getError(Ljava/lang/Object;)Ljava/lang/Throwable;
- move-result-object v0
- invoke-interface {v1, v0}, Lio/reactivex/Observer;->onError(Ljava/lang/Throwable;)V
- .line 648
- :goto_3
- iput-object v6, p1, Lio/reactivex/subjects/ReplaySubject$ReplayDisposable;->index:Ljava/lang/Object;
- .line 649
- iput-boolean v4, p1, Lio/reactivex/subjects/ReplaySubject$ReplayDisposable;->cancelled:Z
- return-void
- .line 655
- :cond_6
- invoke-interface {v1, v7}, Lio/reactivex/Observer;->onNext(Ljava/lang/Object;)V
- add-int/lit8 v3, v3, 0x1
- goto :goto_2
- .line 659
- :cond_7
- iget v5, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->size:I
- if-eq v3, v5, :cond_8
- goto :goto_1
- .line 663
- :cond_8
- invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object v5
- iput-object v5, p1, Lio/reactivex/subjects/ReplaySubject$ReplayDisposable;->index:Ljava/lang/Object;
- neg-int v2, v2
- .line 665
- invoke-virtual {p1, v2}, Lio/reactivex/subjects/ReplaySubject$ReplayDisposable;->addAndGet(I)I
- move-result v2
- if-nez v2, :cond_2
- return-void
- .end method
- .method public size()I
- .locals 4
- .line 674
- iget v0, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->size:I
- if-eqz v0, :cond_2
- .line 676
- iget-object v1, p0, Lio/reactivex/subjects/ReplaySubject$UnboundedReplayBuffer;->buffer:Ljava/util/List;
- add-int/lit8 v2, v0, -0x1
- invoke-interface {v1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object v1
- .line 677
- invoke-static {v1}, Lio/reactivex/internal/util/NotificationLite;->isComplete(Ljava/lang/Object;)Z
- move-result v3
- if-nez v3, :cond_1
- invoke-static {v1}, Lio/reactivex/internal/util/NotificationLite;->isError(Ljava/lang/Object;)Z
- move-result v1
- if-eqz v1, :cond_0
- goto :goto_0
- :cond_0
- return v0
- :cond_1
- :goto_0
- return v2
- :cond_2
- const/4 v0, 0x0
- return v0
- .end method
|