529 lines
15 KiB
Smali
529 lines
15 KiB
Smali
.class final Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;
|
|
.super Ljava/util/concurrent/atomic/AtomicInteger;
|
|
.source "ObservableGroupBy.java"
|
|
|
|
# interfaces
|
|
.implements Lio/reactivex/disposables/b;
|
|
.implements Lkh/e0;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lio/reactivex/internal/operators/observable/ObservableGroupBy;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "State"
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
"K:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Ljava/util/concurrent/atomic/AtomicInteger;",
|
|
"Lio/reactivex/disposables/b;",
|
|
"Lkh/e0<",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final serialVersionUID:J = -0x35762a4bbab31538L
|
|
|
|
|
|
# instance fields
|
|
.field public final actual:Ljava/util/concurrent/atomic/AtomicReference;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/concurrent/atomic/AtomicReference<",
|
|
"Lkh/g0<",
|
|
"-TT;>;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final cancelled:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
.field public final delayError:Z
|
|
|
|
.field public volatile done:Z
|
|
|
|
.field public error:Ljava/lang/Throwable;
|
|
|
|
.field public final key:Ljava/lang/Object;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"TK;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final once:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
.field public final parent:Lio/reactivex/internal/operators/observable/ObservableGroupBy$GroupByObserver;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lio/reactivex/internal/operators/observable/ObservableGroupBy$GroupByObserver<",
|
|
"*TK;TT;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final queue:Lio/reactivex/internal/queue/a;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lio/reactivex/internal/queue/a<",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(ILio/reactivex/internal/operators/observable/ObservableGroupBy$GroupByObserver;Ljava/lang/Object;Z)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(I",
|
|
"Lio/reactivex/internal/operators/observable/ObservableGroupBy$GroupByObserver<",
|
|
"*TK;TT;>;TK;Z)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>()V
|
|
|
|
.line 2
|
|
new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>()V
|
|
|
|
iput-object v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->cancelled:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
.line 3
|
|
new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>()V
|
|
|
|
iput-object v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->once:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
.line 4
|
|
new-instance v0, Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicReference;-><init>()V
|
|
|
|
iput-object v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->actual:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
.line 5
|
|
new-instance v0, Lio/reactivex/internal/queue/a;
|
|
|
|
invoke-direct {v0, p1}, Lio/reactivex/internal/queue/a;-><init>(I)V
|
|
|
|
iput-object v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->queue:Lio/reactivex/internal/queue/a;
|
|
|
|
.line 6
|
|
iput-object p2, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->parent:Lio/reactivex/internal/operators/observable/ObservableGroupBy$GroupByObserver;
|
|
|
|
.line 7
|
|
iput-object p3, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->key:Ljava/lang/Object;
|
|
|
|
.line 8
|
|
iput-boolean p4, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->delayError:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public checkTerminated(ZZLkh/g0;Z)Z
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(ZZ",
|
|
"Lkh/g0<",
|
|
"-TT;>;Z)Z"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->cancelled:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
iget-object p1, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->queue:Lio/reactivex/internal/queue/a;
|
|
|
|
invoke-virtual {p1}, Lio/reactivex/internal/queue/a;->clear()V
|
|
|
|
.line 3
|
|
iget-object p1, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->parent:Lio/reactivex/internal/operators/observable/ObservableGroupBy$GroupByObserver;
|
|
|
|
iget-object p2, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->key:Ljava/lang/Object;
|
|
|
|
invoke-virtual {p1, p2}, Lio/reactivex/internal/operators/observable/ObservableGroupBy$GroupByObserver;->cancel(Ljava/lang/Object;)V
|
|
|
|
.line 4
|
|
iget-object p1, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->actual:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {p1, v2}, Ljava/util/concurrent/atomic/AtomicReference;->lazySet(Ljava/lang/Object;)V
|
|
|
|
return v1
|
|
|
|
:cond_0
|
|
if-eqz p1, :cond_4
|
|
|
|
if-eqz p4, :cond_2
|
|
|
|
if-eqz p2, :cond_4
|
|
|
|
.line 5
|
|
iget-object p1, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->error:Ljava/lang/Throwable;
|
|
|
|
.line 6
|
|
iget-object p2, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->actual:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {p2, v2}, Ljava/util/concurrent/atomic/AtomicReference;->lazySet(Ljava/lang/Object;)V
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 7
|
|
invoke-interface {p3, p1}, Lkh/g0;->onError(Ljava/lang/Throwable;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 8
|
|
:cond_1
|
|
invoke-interface {p3}, Lkh/g0;->onComplete()V
|
|
|
|
:goto_0
|
|
return v1
|
|
|
|
.line 9
|
|
:cond_2
|
|
iget-object p1, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->error:Ljava/lang/Throwable;
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
.line 10
|
|
iget-object p2, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->queue:Lio/reactivex/internal/queue/a;
|
|
|
|
invoke-virtual {p2}, Lio/reactivex/internal/queue/a;->clear()V
|
|
|
|
.line 11
|
|
iget-object p2, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->actual:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {p2, v2}, Ljava/util/concurrent/atomic/AtomicReference;->lazySet(Ljava/lang/Object;)V
|
|
|
|
.line 12
|
|
invoke-interface {p3, p1}, Lkh/g0;->onError(Ljava/lang/Throwable;)V
|
|
|
|
return v1
|
|
|
|
:cond_3
|
|
if-eqz p2, :cond_4
|
|
|
|
.line 13
|
|
iget-object p1, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->actual:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {p1, v2}, Ljava/util/concurrent/atomic/AtomicReference;->lazySet(Ljava/lang/Object;)V
|
|
|
|
.line 14
|
|
invoke-interface {p3}, Lkh/g0;->onComplete()V
|
|
|
|
return v1
|
|
|
|
:cond_4
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public dispose()V
|
|
.locals 3
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->cancelled:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-virtual {v0, v1, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->compareAndSet(ZZ)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicInteger;->getAndIncrement()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 3
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->actual:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/concurrent/atomic/AtomicReference;->lazySet(Ljava/lang/Object;)V
|
|
|
|
.line 4
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->parent:Lio/reactivex/internal/operators/observable/ObservableGroupBy$GroupByObserver;
|
|
|
|
iget-object v1, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->key:Ljava/lang/Object;
|
|
|
|
invoke-virtual {v0, v1}, Lio/reactivex/internal/operators/observable/ObservableGroupBy$GroupByObserver;->cancel(Ljava/lang/Object;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public drain()V
|
|
.locals 8
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicInteger;->getAndIncrement()I
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 2
|
|
:cond_0
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->queue:Lio/reactivex/internal/queue/a;
|
|
|
|
.line 3
|
|
iget-boolean v1, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->delayError:Z
|
|
|
|
.line 4
|
|
iget-object v2, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->actual:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {v2}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lkh/g0;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
move v4, v3
|
|
|
|
:cond_1
|
|
:goto_0
|
|
if-eqz v2, :cond_5
|
|
|
|
.line 5
|
|
:goto_1
|
|
iget-boolean v5, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->done:Z
|
|
|
|
.line 6
|
|
invoke-virtual {v0}, Lio/reactivex/internal/queue/a;->poll()Ljava/lang/Object;
|
|
|
|
move-result-object v6
|
|
|
|
if-nez v6, :cond_2
|
|
|
|
move v7, v3
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
const/4 v7, 0x0
|
|
|
|
.line 7
|
|
:goto_2
|
|
invoke-virtual {p0, v5, v7, v2, v1}, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->checkTerminated(ZZLkh/g0;Z)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_3
|
|
|
|
return-void
|
|
|
|
:cond_3
|
|
if-eqz v7, :cond_4
|
|
|
|
goto :goto_3
|
|
|
|
.line 8
|
|
:cond_4
|
|
invoke-interface {v2, v6}, Lkh/g0;->onNext(Ljava/lang/Object;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
:goto_3
|
|
neg-int v4, v4
|
|
|
|
.line 9
|
|
invoke-virtual {p0, v4}, Ljava/util/concurrent/atomic/AtomicInteger;->addAndGet(I)I
|
|
|
|
move-result v4
|
|
|
|
if-nez v4, :cond_6
|
|
|
|
return-void
|
|
|
|
:cond_6
|
|
if-nez v2, :cond_1
|
|
|
|
.line 10
|
|
iget-object v2, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->actual:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {v2}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lkh/g0;
|
|
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method public isDisposed()Z
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->cancelled:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public onComplete()V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 1
|
|
iput-boolean v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->done:Z
|
|
|
|
.line 2
|
|
invoke-virtual {p0}, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->drain()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onError(Ljava/lang/Throwable;)V
|
|
.locals 0
|
|
|
|
.line 1
|
|
iput-object p1, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->error:Ljava/lang/Throwable;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
.line 2
|
|
iput-boolean p1, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->done:Z
|
|
|
|
.line 3
|
|
invoke-virtual {p0}, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->drain()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onNext(Ljava/lang/Object;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(TT;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->queue:Lio/reactivex/internal/queue/a;
|
|
|
|
invoke-virtual {v0, p1}, Lio/reactivex/internal/queue/a;->offer(Ljava/lang/Object;)Z
|
|
|
|
.line 2
|
|
invoke-virtual {p0}, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->drain()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public subscribe(Lkh/g0;)V
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lkh/g0<",
|
|
"-TT;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->once:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-virtual {v0, v1, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->compareAndSet(ZZ)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 2
|
|
invoke-interface {p1, p0}, Lkh/g0;->onSubscribe(Lio/reactivex/disposables/b;)V
|
|
|
|
.line 3
|
|
iget-object v0, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->actual:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/concurrent/atomic/AtomicReference;->lazySet(Ljava/lang/Object;)V
|
|
|
|
.line 4
|
|
iget-object p1, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->cancelled:Ljava/util/concurrent/atomic/AtomicBoolean;
|
|
|
|
invoke-virtual {p1}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 5
|
|
iget-object p1, p0, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->actual:Ljava/util/concurrent/atomic/AtomicReference;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-virtual {p1, v0}, Ljava/util/concurrent/atomic/AtomicReference;->lazySet(Ljava/lang/Object;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 6
|
|
:cond_0
|
|
invoke-virtual {p0}, Lio/reactivex/internal/operators/observable/ObservableGroupBy$State;->drain()V
|
|
|
|
goto :goto_0
|
|
|
|
.line 7
|
|
:cond_1
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v1, "Only one Observer allowed!"
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-static {v0, p1}, Lio/reactivex/internal/disposables/EmptyDisposable;->error(Ljava/lang/Throwable;Lkh/g0;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|