今奥全景相机
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

470 lines
13 KiB

.class Lcom/google/common/cache/LocalCache$LoadingValueReference;
.super Ljava/lang/Object;
.source "LocalCache.java"
# interfaces
.implements Lcom/google/common/cache/LocalCache$ValueReference;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/google/common/cache/LocalCache;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x8
name = "LoadingValueReference"
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<K:",
"Ljava/lang/Object;",
"V:",
"Ljava/lang/Object;",
">",
"Ljava/lang/Object;",
"Lcom/google/common/cache/LocalCache$ValueReference",
"<TK;TV;>;"
}
.end annotation
# instance fields
.field final futureValue:Lcom/google/common/util/concurrent/SettableFuture;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/google/common/util/concurrent/SettableFuture",
"<TV;>;"
}
.end annotation
.end field
.field volatile oldValue:Lcom/google/common/cache/LocalCache$ValueReference;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/google/common/cache/LocalCache$ValueReference",
"<TK;TV;>;"
}
.end annotation
.end field
.field final stopwatch:Lcom/google/common/base/Stopwatch;
# direct methods
.method public constructor <init>()V
.locals 1
.prologue
.line 3471
invoke-static {}, Lcom/google/common/cache/LocalCache;->unset()Lcom/google/common/cache/LocalCache$ValueReference;
move-result-object v0
invoke-direct {p0, v0}, Lcom/google/common/cache/LocalCache$LoadingValueReference;-><init>(Lcom/google/common/cache/LocalCache$ValueReference;)V
.line 3472
return-void
.end method
.method public constructor <init>(Lcom/google/common/cache/LocalCache$ValueReference;)V
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/common/cache/LocalCache$ValueReference",
"<TK;TV;>;)V"
}
.end annotation
.prologue
.line 3474
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 3467
invoke-static {}, Lcom/google/common/util/concurrent/SettableFuture;->create()Lcom/google/common/util/concurrent/SettableFuture;
move-result-object v0
iput-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->futureValue:Lcom/google/common/util/concurrent/SettableFuture;
.line 3468
invoke-static {}, Lcom/google/common/base/Stopwatch;->createUnstarted()Lcom/google/common/base/Stopwatch;
move-result-object v0
iput-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->stopwatch:Lcom/google/common/base/Stopwatch;
.line 3475
iput-object p1, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->oldValue:Lcom/google/common/cache/LocalCache$ValueReference;
.line 3476
return-void
.end method
.method private fullyFailedFuture(Ljava/lang/Throwable;)Lcom/google/common/util/concurrent/ListenableFuture;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/Throwable;",
")",
"Lcom/google/common/util/concurrent/ListenableFuture",
"<TV;>;"
}
.end annotation
.prologue
.line 3502
invoke-static {p1}, Lcom/google/common/util/concurrent/Futures;->immediateFailedFuture(Ljava/lang/Throwable;)Lcom/google/common/util/concurrent/ListenableFuture;
move-result-object v0
return-object v0
.end method
# virtual methods
.method public copyFor(Ljava/lang/ref/ReferenceQueue;Ljava/lang/Object;Lcom/google/common/cache/LocalCache$ReferenceEntry;)Lcom/google/common/cache/LocalCache$ValueReference;
.locals 0
.param p2 # Ljava/lang/Object;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/ref/ReferenceQueue",
"<TV;>;TV;",
"Lcom/google/common/cache/LocalCache$ReferenceEntry",
"<TK;TV;>;)",
"Lcom/google/common/cache/LocalCache$ValueReference",
"<TK;TV;>;"
}
.end annotation
.prologue
.line 3574
return-object p0
.end method
.method public elapsedNanos()J
.locals 2
.prologue
.line 3549
iget-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->stopwatch:Lcom/google/common/base/Stopwatch;
sget-object v1, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {v0, v1}, Lcom/google/common/base/Stopwatch;->elapsed(Ljava/util/concurrent/TimeUnit;)J
move-result-wide v0
return-wide v0
.end method
.method public get()Ljava/lang/Object;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"()TV;"
}
.end annotation
.prologue
.line 3559
iget-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->oldValue:Lcom/google/common/cache/LocalCache$ValueReference;
invoke-interface {v0}, Lcom/google/common/cache/LocalCache$ValueReference;->get()Ljava/lang/Object;
move-result-object v0
return-object v0
.end method
.method public getEntry()Lcom/google/common/cache/LocalCache$ReferenceEntry;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lcom/google/common/cache/LocalCache$ReferenceEntry",
"<TK;TV;>;"
}
.end annotation
.prologue
.line 3568
const/4 v0, 0x0
return-object v0
.end method
.method public getOldValue()Lcom/google/common/cache/LocalCache$ValueReference;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lcom/google/common/cache/LocalCache$ValueReference",
"<TK;TV;>;"
}
.end annotation
.prologue
.line 3563
iget-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->oldValue:Lcom/google/common/cache/LocalCache$ValueReference;
return-object v0
.end method
.method public getWeight()I
.locals 1
.prologue
.line 3490
iget-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->oldValue:Lcom/google/common/cache/LocalCache$ValueReference;
invoke-interface {v0}, Lcom/google/common/cache/LocalCache$ValueReference;->getWeight()I
move-result v0
return v0
.end method
.method public isActive()Z
.locals 1
.prologue
.line 3485
iget-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->oldValue:Lcom/google/common/cache/LocalCache$ValueReference;
invoke-interface {v0}, Lcom/google/common/cache/LocalCache$ValueReference;->isActive()Z
move-result v0
return v0
.end method
.method public isLoading()Z
.locals 1
.prologue
.line 3480
const/4 v0, 0x1
return v0
.end method
.method public loadFuture(Ljava/lang/Object;Lcom/google/common/cache/CacheLoader;)Lcom/google/common/util/concurrent/ListenableFuture;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(TK;",
"Lcom/google/common/cache/CacheLoader",
"<-TK;TV;>;)",
"Lcom/google/common/util/concurrent/ListenableFuture",
"<TV;>;"
}
.end annotation
.prologue
.line 3520
iget-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->stopwatch:Lcom/google/common/base/Stopwatch;
invoke-virtual {v0}, Lcom/google/common/base/Stopwatch;->start()Lcom/google/common/base/Stopwatch;
.line 3521
iget-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->oldValue:Lcom/google/common/cache/LocalCache$ValueReference;
invoke-interface {v0}, Lcom/google/common/cache/LocalCache$ValueReference;->get()Ljava/lang/Object;
move-result-object v0
.line 3523
if-nez v0, :cond_1
.line 3524
:try_start_0
invoke-virtual {p2, p1}, Lcom/google/common/cache/CacheLoader;->load(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
.line 3525
invoke-virtual {p0, v0}, Lcom/google/common/cache/LocalCache$LoadingValueReference;->set(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
iget-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->futureValue:Lcom/google/common/util/concurrent/SettableFuture;
.line 3544
:goto_0
return-object v0
.line 3525
:cond_0
invoke-static {v0}, Lcom/google/common/util/concurrent/Futures;->immediateFuture(Ljava/lang/Object;)Lcom/google/common/util/concurrent/ListenableFuture;
move-result-object v0
goto :goto_0
.line 3527
:cond_1
invoke-virtual {p2, p1, v0}, Lcom/google/common/cache/CacheLoader;->reload(Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/common/util/concurrent/ListenableFuture;
move-result-object v0
.line 3528
if-nez v0, :cond_2
.line 3529
const/4 v0, 0x0
invoke-static {v0}, Lcom/google/common/util/concurrent/Futures;->immediateFuture(Ljava/lang/Object;)Lcom/google/common/util/concurrent/ListenableFuture;
move-result-object v0
goto :goto_0
.line 3533
:cond_2
new-instance v1, Lcom/google/common/cache/LocalCache$LoadingValueReference$1;
invoke-direct {v1, p0}, Lcom/google/common/cache/LocalCache$LoadingValueReference$1;-><init>(Lcom/google/common/cache/LocalCache$LoadingValueReference;)V
invoke-static {v0, v1}, Lcom/google/common/util/concurrent/Futures;->transform(Lcom/google/common/util/concurrent/ListenableFuture;Lcom/google/common/base/Function;)Lcom/google/common/util/concurrent/ListenableFuture;
:try_end_0
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v0
goto :goto_0
.line 3540
:catch_0
move-exception v0
.line 3541
instance-of v1, v0, Ljava/lang/InterruptedException;
if-eqz v1, :cond_3
.line 3542
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Thread;->interrupt()V
.line 3544
:cond_3
invoke-virtual {p0, v0}, Lcom/google/common/cache/LocalCache$LoadingValueReference;->setException(Ljava/lang/Throwable;)Z
move-result v1
if-eqz v1, :cond_4
iget-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->futureValue:Lcom/google/common/util/concurrent/SettableFuture;
goto :goto_0
:cond_4
invoke-direct {p0, v0}, Lcom/google/common/cache/LocalCache$LoadingValueReference;->fullyFailedFuture(Ljava/lang/Throwable;)Lcom/google/common/util/concurrent/ListenableFuture;
move-result-object v0
goto :goto_0
.end method
.method public notifyNewValue(Ljava/lang/Object;)V
.locals 1
.param p1 # Ljava/lang/Object;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(TV;)V"
}
.end annotation
.prologue
.line 3507
if-eqz p1, :cond_0
.line 3510
invoke-virtual {p0, p1}, Lcom/google/common/cache/LocalCache$LoadingValueReference;->set(Ljava/lang/Object;)Z
.line 3517
:goto_0
return-void
.line 3513
:cond_0
invoke-static {}, Lcom/google/common/cache/LocalCache;->unset()Lcom/google/common/cache/LocalCache$ValueReference;
move-result-object v0
iput-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->oldValue:Lcom/google/common/cache/LocalCache$ValueReference;
goto :goto_0
.end method
.method public set(Ljava/lang/Object;)Z
.locals 1
.param p1 # Ljava/lang/Object;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(TV;)Z"
}
.end annotation
.prologue
.line 3494
iget-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->futureValue:Lcom/google/common/util/concurrent/SettableFuture;
invoke-virtual {v0, p1}, Lcom/google/common/util/concurrent/SettableFuture;->set(Ljava/lang/Object;)Z
move-result v0
return v0
.end method
.method public setException(Ljava/lang/Throwable;)Z
.locals 1
.prologue
.line 3498
iget-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->futureValue:Lcom/google/common/util/concurrent/SettableFuture;
invoke-virtual {v0, p1}, Lcom/google/common/util/concurrent/SettableFuture;->setException(Ljava/lang/Throwable;)Z
move-result v0
return v0
.end method
.method public waitForValue()Ljava/lang/Object;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"()TV;"
}
.end annotation
.prologue
.line 3554
iget-object v0, p0, Lcom/google/common/cache/LocalCache$LoadingValueReference;->futureValue:Lcom/google/common/util/concurrent/SettableFuture;
invoke-static {v0}, Lcom/google/common/util/concurrent/Uninterruptibles;->getUninterruptibly(Ljava/util/concurrent/Future;)Ljava/lang/Object;
move-result-object v0
return-object v0
.end method