e.smali
.class public Le/e/e;
.super Ljava/lang/Object;
.source ""
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
"<K:",
"Ljava/lang/Object;",
"V:",
"Ljava/lang/Object;",
">",
"Ljava/lang/Object;"
}
.end annotation
# instance fields
.field private createCount:I
.field private evictionCount:I
.field private hitCount:I
.field private final map:Ljava/util/LinkedHashMap;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/LinkedHashMap<",
"TK;TV;>;"
}
.end annotation
.end field
.field private maxSize:I
.field private missCount:I
.field private putCount:I
.field private size:I
# direct methods
.method public constructor <init>(I)V
.registers 5
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
if-lez p1, :cond_13
iput p1, p0, Le/e/e;->maxSize:I
new-instance p1, Ljava/util/LinkedHashMap;
const/4 v0, 0x0
const/high16 v1, 0x3f400000 # 0.75f
const/4 v2, 0x1
invoke-direct {p1, v0, v1, v2}, Ljava/util/LinkedHashMap;-><init>(IFZ)V
iput-object p1, p0, Le/e/e;->map:Ljava/util/LinkedHashMap;
return-void
:cond_13
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "maxSize <= 0"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method private safeSizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
.registers 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(TK;TV;)I"
}
.end annotation
invoke-virtual {p0, p1, p2}, Le/e/e;->sizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
move-result v0
if-ltz v0, :cond_7
return v0
:cond_7
new-instance v0, Ljava/lang/IllegalStateException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Negative size: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string p1, "="
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-direct {v0, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
# virtual methods
.method protected create(Ljava/lang/Object;)Ljava/lang/Object;
.registers 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(TK;)TV;"
}
.end annotation
const/4 p1, 0x0
return-object p1
.end method
.method public final declared-synchronized createCount()I
.registers 2
monitor-enter p0
:try_start_1
iget v0, p0, Le/e/e;->createCount:I
:try_end_3
.catchall {:try_start_1 .. :try_end_3} :catchall_5
monitor-exit p0
return v0
:catchall_5
move-exception v0
monitor-exit p0
throw v0
.end method
.method protected entryRemoved(ZLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
.registers 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(ZTK;TV;TV;)V"
}
.end annotation
return-void
.end method
.method public final evictAll()V
.registers 2
const/4 v0, -0x1
invoke-virtual {p0, v0}, Le/e/e;->trimToSize(I)V
return-void
.end method
.method public final declared-synchronized evictionCount()I
.registers 2
monitor-enter p0
:try_start_1
iget v0, p0, Le/e/e;->evictionCount:I
:try_end_3
.catchall {:try_start_1 .. :try_end_3} :catchall_5
monitor-exit p0
return v0
:catchall_5
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final get(Ljava/lang/Object;)Ljava/lang/Object;
.registers 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(TK;)TV;"
}
.end annotation
if-eqz p1, :cond_54
monitor-enter p0
:try_start_3
iget-object v0, p0, Le/e/e;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v0, p1}, Ljava/util/LinkedHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
if-eqz v0, :cond_13
iget p1, p0, Le/e/e;->hitCount:I
add-int/lit8 p1, p1, 0x1
iput p1, p0, Le/e/e;->hitCount:I
monitor-exit p0
return-object v0
:cond_13
iget v0, p0, Le/e/e;->missCount:I
add-int/lit8 v0, v0, 0x1
iput v0, p0, Le/e/e;->missCount:I
monitor-exit p0
:try_end_1a
.catchall {:try_start_3 .. :try_end_1a} :catchall_51
invoke-virtual {p0, p1}, Le/e/e;->create(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
if-nez v0, :cond_22
const/4 p1, 0x0
return-object p1
:cond_22
monitor-enter p0
:try_start_23
iget v1, p0, Le/e/e;->createCount:I
add-int/lit8 v1, v1, 0x1
iput v1, p0, Le/e/e;->createCount:I
iget-object v1, p0, Le/e/e;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v1, p1, v0}, Ljava/util/LinkedHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v1
if-eqz v1, :cond_37
iget-object v2, p0, Le/e/e;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v2, p1, v1}, Ljava/util/LinkedHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
goto :goto_40
:cond_37
iget v2, p0, Le/e/e;->size:I
invoke-direct {p0, p1, v0}, Le/e/e;->safeSizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
move-result v3
add-int/2addr v2, v3
iput v2, p0, Le/e/e;->size:I
:goto_40
monitor-exit p0
:try_end_41
.catchall {:try_start_23 .. :try_end_41} :catchall_4e
if-eqz v1, :cond_48
const/4 v2, 0x0
invoke-virtual {p0, v2, p1, v0, v1}, Le/e/e;->entryRemoved(ZLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
return-object v1
:cond_48
iget p1, p0, Le/e/e;->maxSize:I
invoke-virtual {p0, p1}, Le/e/e;->trimToSize(I)V
return-object v0
:catchall_4e
move-exception p1
:try_start_4f
monitor-exit p0
:try_end_50
.catchall {:try_start_4f .. :try_end_50} :catchall_4e
throw p1
:catchall_51
move-exception p1
:try_start_52
monitor-exit p0
:try_end_53
.catchall {:try_start_52 .. :try_end_53} :catchall_51
throw p1
:cond_54
new-instance p1, Ljava/lang/NullPointerException;
const-string v0, "key == null"
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public final declared-synchronized hitCount()I
.registers 2
monitor-enter p0
:try_start_1
iget v0, p0, Le/e/e;->hitCount:I
:try_end_3
.catchall {:try_start_1 .. :try_end_3} :catchall_5
monitor-exit p0
return v0
:catchall_5
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final declared-synchronized maxSize()I
.registers 2
monitor-enter p0
:try_start_1
iget v0, p0, Le/e/e;->maxSize:I
:try_end_3
.catchall {:try_start_1 .. :try_end_3} :catchall_5
monitor-exit p0
return v0
:catchall_5
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final declared-synchronized missCount()I
.registers 2
monitor-enter p0
:try_start_1
iget v0, p0, Le/e/e;->missCount:I
:try_end_3
.catchall {:try_start_1 .. :try_end_3} :catchall_5
monitor-exit p0
return v0
:catchall_5
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.registers 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(TK;TV;)TV;"
}
.end annotation
if-eqz p1, :cond_35
if-eqz p2, :cond_35
monitor-enter p0
:try_start_5
iget v0, p0, Le/e/e;->putCount:I
add-int/lit8 v0, v0, 0x1
iput v0, p0, Le/e/e;->putCount:I
iget v0, p0, Le/e/e;->size:I
invoke-direct {p0, p1, p2}, Le/e/e;->safeSizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
move-result v1
add-int/2addr v0, v1
iput v0, p0, Le/e/e;->size:I
iget-object v0, p0, Le/e/e;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v0, p1, p2}, Ljava/util/LinkedHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
if-eqz v0, :cond_25
iget v1, p0, Le/e/e;->size:I
invoke-direct {p0, p1, v0}, Le/e/e;->safeSizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
move-result v2
sub-int/2addr v1, v2
iput v1, p0, Le/e/e;->size:I
:cond_25
monitor-exit p0
:try_end_26
.catchall {:try_start_5 .. :try_end_26} :catchall_32
if-eqz v0, :cond_2c
const/4 v1, 0x0
invoke-virtual {p0, v1, p1, v0, p2}, Le/e/e;->entryRemoved(ZLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
:cond_2c
iget p1, p0, Le/e/e;->maxSize:I
invoke-virtual {p0, p1}, Le/e/e;->trimToSize(I)V
return-object v0
:catchall_32
move-exception p1
:try_start_33
monitor-exit p0
:try_end_34
.catchall {:try_start_33 .. :try_end_34} :catchall_32
throw p1
:cond_35
new-instance p1, Ljava/lang/NullPointerException;
const-string p2, "key == null || value == null"
invoke-direct {p1, p2}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public final declared-synchronized putCount()I
.registers 2
monitor-enter p0
:try_start_1
iget v0, p0, Le/e/e;->putCount:I
:try_end_3
.catchall {:try_start_1 .. :try_end_3} :catchall_5
monitor-exit p0
return v0
:catchall_5
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final remove(Ljava/lang/Object;)Ljava/lang/Object;
.registers 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(TK;)TV;"
}
.end annotation
if-eqz p1, :cond_20
monitor-enter p0
:try_start_3
iget-object v0, p0, Le/e/e;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v0, p1}, Ljava/util/LinkedHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
if-eqz v0, :cond_14
iget v1, p0, Le/e/e;->size:I
invoke-direct {p0, p1, v0}, Le/e/e;->safeSizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
move-result v2
sub-int/2addr v1, v2
iput v1, p0, Le/e/e;->size:I
:cond_14
monitor-exit p0
:try_end_15
.catchall {:try_start_3 .. :try_end_15} :catchall_1d
if-eqz v0, :cond_1c
const/4 v1, 0x0
const/4 v2, 0x0
invoke-virtual {p0, v1, p1, v0, v2}, Le/e/e;->entryRemoved(ZLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
:cond_1c
return-object v0
:catchall_1d
move-exception p1
:try_start_1e
monitor-exit p0
:try_end_1f
.catchall {:try_start_1e .. :try_end_1f} :catchall_1d
throw p1
:cond_20
new-instance p1, Ljava/lang/NullPointerException;
const-string v0, "key == null"
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public resize(I)V
.registers 3
if-lez p1, :cond_d
monitor-enter p0
:try_start_3
iput p1, p0, Le/e/e;->maxSize:I
monitor-exit p0
:try_end_6
.catchall {:try_start_3 .. :try_end_6} :catchall_a
invoke-virtual {p0, p1}, Le/e/e;->trimToSize(I)V
return-void
:catchall_a
move-exception p1
:try_start_b
monitor-exit p0
:try_end_c
.catchall {:try_start_b .. :try_end_c} :catchall_a
throw p1
:cond_d
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "maxSize <= 0"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public final declared-synchronized size()I
.registers 2
monitor-enter p0
:try_start_1
iget v0, p0, Le/e/e;->size:I
:try_end_3
.catchall {:try_start_1 .. :try_end_3} :catchall_5
monitor-exit p0
return v0
:catchall_5
move-exception v0
monitor-exit p0
throw v0
.end method
.method protected sizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
.registers 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(TK;TV;)I"
}
.end annotation
const/4 p1, 0x1
return p1
.end method
.method public final declared-synchronized snapshot()Ljava/util/Map;
.registers 3
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/Map<",
"TK;TV;>;"
}
.end annotation
monitor-enter p0
:try_start_1
new-instance v0, Ljava/util/LinkedHashMap;
iget-object v1, p0, Le/e/e;->map:Ljava/util/LinkedHashMap;
invoke-direct {v0, v1}, Ljava/util/LinkedHashMap;-><init>(Ljava/util/Map;)V
:try_end_8
.catchall {:try_start_1 .. :try_end_8} :catchall_a
monitor-exit p0
return-object v0
:catchall_a
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final declared-synchronized toString()Ljava/lang/String;
.registers 7
monitor-enter p0
:try_start_1
iget v0, p0, Le/e/e;->hitCount:I
iget v1, p0, Le/e/e;->missCount:I
add-int/2addr v1, v0
const/4 v2, 0x0
if-eqz v1, :cond_d
mul-int/lit8 v0, v0, 0x64
div-int/2addr v0, v1
goto :goto_e
:cond_d
const/4 v0, 0x0
:goto_e
sget-object v1, Ljava/util/Locale;->US:Ljava/util/Locale;
const-string v3, "LruCache[maxSize=%d,hits=%d,misses=%d,hitRate=%d%%]"
const/4 v4, 0x4
new-array v4, v4, [Ljava/lang/Object;
iget v5, p0, Le/e/e;->maxSize:I
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v5
aput-object v5, v4, v2
const/4 v2, 0x1
iget v5, p0, Le/e/e;->hitCount:I
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v5
aput-object v5, v4, v2
const/4 v2, 0x2
iget v5, p0, Le/e/e;->missCount:I
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v5
aput-object v5, v4, v2
const/4 v2, 0x3
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v0
aput-object v0, v4, v2
invoke-static {v1, v3, v4}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v0
:try_end_3a
.catchall {:try_start_1 .. :try_end_3a} :catchall_3c
monitor-exit p0
return-object v0
:catchall_3c
move-exception v0
monitor-exit p0
throw v0
.end method
.method public trimToSize(I)V
.registers 6
:goto_0
monitor-enter p0
:try_start_1
iget v0, p0, Le/e/e;->size:I
if-ltz v0, :cond_52
iget-object v0, p0, Le/e/e;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v0}, Ljava/util/LinkedHashMap;->isEmpty()Z
move-result v0
if-eqz v0, :cond_11
iget v0, p0, Le/e/e;->size:I
if-nez v0, :cond_52
:cond_11
iget v0, p0, Le/e/e;->size:I
if-le v0, p1, :cond_50
iget-object v0, p0, Le/e/e;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v0}, Ljava/util/LinkedHashMap;->isEmpty()Z
move-result v0
if-eqz v0, :cond_1e
goto :goto_50
:cond_1e
iget-object v0, p0, Le/e/e;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v0}, Ljava/util/LinkedHashMap;->entrySet()Ljava/util/Set;
move-result-object v0
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v0
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/util/Map$Entry;
invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v1
invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v0
iget-object v2, p0, Le/e/e;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v2, v1}, Ljava/util/LinkedHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
iget v2, p0, Le/e/e;->size:I
invoke-direct {p0, v1, v0}, Le/e/e;->safeSizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
move-result v3
sub-int/2addr v2, v3
iput v2, p0, Le/e/e;->size:I
iget v2, p0, Le/e/e;->evictionCount:I
const/4 v3, 0x1
add-int/2addr v2, v3
iput v2, p0, Le/e/e;->evictionCount:I
monitor-exit p0
:try_end_4b
.catchall {:try_start_1 .. :try_end_4b} :catchall_71
const/4 v2, 0x0
invoke-virtual {p0, v3, v1, v0, v2}, Le/e/e;->entryRemoved(ZLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
goto :goto_0
:cond_50
:goto_50
:try_start_50
monitor-exit p0
return-void
:cond_52
new-instance p1, Ljava/lang/IllegalStateException;
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, ".sizeOf() is reporting inconsistent results!"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
:catchall_71
move-exception p1
monitor-exit p0
:try_end_73
.catchall {:try_start_50 .. :try_end_73} :catchall_71
goto :goto_75
:goto_74
throw p1
:goto_75
goto :goto_74
.end method