574 lines
16 KiB
Smali
574 lines
16 KiB
Smali
.class public final Lcom/google/common/collect/MapMaker;
|
|
.super Ljava/lang/Object;
|
|
.source "MapMaker.java"
|
|
|
|
|
|
# annotations
|
|
.annotation build Lcom/google/common/annotations/GwtCompatible;
|
|
emulated = true
|
|
.end annotation
|
|
|
|
.annotation runtime Lcom/google/common/collect/ElementTypesAreNonnullByDefault;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/google/common/collect/MapMaker$Dummy;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final DEFAULT_CONCURRENCY_LEVEL:I = 0x4
|
|
|
|
.field private static final DEFAULT_INITIAL_CAPACITY:I = 0x10
|
|
|
|
.field public static final UNSET_INT:I = -0x1
|
|
|
|
|
|
# instance fields
|
|
.field public concurrencyLevel:I
|
|
|
|
.field public initialCapacity:I
|
|
|
|
.field public keyEquivalence:Lcom/google/common/base/Equivalence;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/google/common/base/Equivalence<",
|
|
"Ljava/lang/Object;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljavax/annotation/CheckForNull;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public keyStrength:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
.annotation runtime Ljavax/annotation/CheckForNull;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public useCustomMap:Z
|
|
|
|
.field public valueStrength:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
.annotation runtime Ljavax/annotation/CheckForNull;
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const/4 v0, -0x1
|
|
|
|
.line 2
|
|
iput v0, p0, Lcom/google/common/collect/MapMaker;->initialCapacity:I
|
|
|
|
.line 3
|
|
iput v0, p0, Lcom/google/common/collect/MapMaker;->concurrencyLevel:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public concurrencyLevel(I)Lcom/google/common/collect/MapMaker;
|
|
.locals 5
|
|
.annotation build Lcom/google/errorprone/annotations/CanIgnoreReturnValue;
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget v0, p0, Lcom/google/common/collect/MapMaker;->concurrencyLevel:I
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, -0x1
|
|
|
|
if-ne v0, v3, :cond_0
|
|
|
|
move v3, v1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move v3, v2
|
|
|
|
:goto_0
|
|
const-string v4, "concurrency level was already set to %s"
|
|
|
|
invoke-static {v3, v4, v0}, Lcom/google/common/base/Preconditions;->checkState(ZLjava/lang/String;I)V
|
|
|
|
if-lez p1, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
move v1, v2
|
|
|
|
.line 2
|
|
:goto_1
|
|
invoke-static {v1}, Lcom/google/common/base/Preconditions;->checkArgument(Z)V
|
|
|
|
.line 3
|
|
iput p1, p0, Lcom/google/common/collect/MapMaker;->concurrencyLevel:I
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public getConcurrencyLevel()I
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget v0, p0, Lcom/google/common/collect/MapMaker;->concurrencyLevel:I
|
|
|
|
const/4 v1, -0x1
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
const/4 v0, 0x4
|
|
|
|
:cond_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public getInitialCapacity()I
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget v0, p0, Lcom/google/common/collect/MapMaker;->initialCapacity:I
|
|
|
|
const/4 v1, -0x1
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
const/16 v0, 0x10
|
|
|
|
:cond_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public getKeyEquivalence()Lcom/google/common/base/Equivalence;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lcom/google/common/base/Equivalence<",
|
|
"Ljava/lang/Object;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/common/collect/MapMaker;->keyEquivalence:Lcom/google/common/base/Equivalence;
|
|
|
|
invoke-virtual {p0}, Lcom/google/common/collect/MapMaker;->getKeyStrength()Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/google/common/collect/MapMakerInternalMap$Strength;->defaultEquivalence()Lcom/google/common/base/Equivalence;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v0, v1}, Lcom/google/common/base/MoreObjects;->firstNonNull(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/google/common/base/Equivalence;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getKeyStrength()Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/common/collect/MapMaker;->keyStrength:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
sget-object v1, Lcom/google/common/collect/MapMakerInternalMap$Strength;->STRONG:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
invoke-static {v0, v1}, Lcom/google/common/base/MoreObjects;->firstNonNull(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getValueStrength()Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/common/collect/MapMaker;->valueStrength:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
sget-object v1, Lcom/google/common/collect/MapMakerInternalMap$Strength;->STRONG:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
invoke-static {v0, v1}, Lcom/google/common/base/MoreObjects;->firstNonNull(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public initialCapacity(I)Lcom/google/common/collect/MapMaker;
|
|
.locals 5
|
|
.annotation build Lcom/google/errorprone/annotations/CanIgnoreReturnValue;
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget v0, p0, Lcom/google/common/collect/MapMaker;->initialCapacity:I
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, -0x1
|
|
|
|
if-ne v0, v3, :cond_0
|
|
|
|
move v3, v1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move v3, v2
|
|
|
|
:goto_0
|
|
const-string v4, "initial capacity was already set to %s"
|
|
|
|
invoke-static {v3, v4, v0}, Lcom/google/common/base/Preconditions;->checkState(ZLjava/lang/String;I)V
|
|
|
|
if-ltz p1, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
move v1, v2
|
|
|
|
.line 2
|
|
:goto_1
|
|
invoke-static {v1}, Lcom/google/common/base/Preconditions;->checkArgument(Z)V
|
|
|
|
.line 3
|
|
iput p1, p0, Lcom/google/common/collect/MapMaker;->initialCapacity:I
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public keyEquivalence(Lcom/google/common/base/Equivalence;)Lcom/google/common/collect/MapMaker;
|
|
.locals 4
|
|
.annotation build Lcom/google/common/annotations/GwtIncompatible;
|
|
.end annotation
|
|
|
|
.annotation build Lcom/google/errorprone/annotations/CanIgnoreReturnValue;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/google/common/base/Equivalence<",
|
|
"Ljava/lang/Object;",
|
|
">;)",
|
|
"Lcom/google/common/collect/MapMaker;"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/common/collect/MapMaker;->keyEquivalence:Lcom/google/common/base/Equivalence;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
move v2, v1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
const-string v3, "key equivalence was already set to %s"
|
|
|
|
invoke-static {v2, v3, v0}, Lcom/google/common/base/Preconditions;->checkState(ZLjava/lang/String;Ljava/lang/Object;)V
|
|
|
|
.line 2
|
|
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/google/common/base/Equivalence;
|
|
|
|
iput-object p1, p0, Lcom/google/common/collect/MapMaker;->keyEquivalence:Lcom/google/common/base/Equivalence;
|
|
|
|
.line 3
|
|
iput-boolean v1, p0, Lcom/google/common/collect/MapMaker;->useCustomMap:Z
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public makeMap()Ljava/util/concurrent/ConcurrentMap;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<K:",
|
|
"Ljava/lang/Object;",
|
|
"V:",
|
|
"Ljava/lang/Object;",
|
|
">()",
|
|
"Ljava/util/concurrent/ConcurrentMap<",
|
|
"TK;TV;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-boolean v0, p0, Lcom/google/common/collect/MapMaker;->useCustomMap:Z
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 2
|
|
new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
invoke-virtual {p0}, Lcom/google/common/collect/MapMaker;->getInitialCapacity()I
|
|
|
|
move-result v1
|
|
|
|
const/high16 v2, 0x3f400000 # 0.75f
|
|
|
|
invoke-virtual {p0}, Lcom/google/common/collect/MapMaker;->getConcurrencyLevel()I
|
|
|
|
move-result v3
|
|
|
|
invoke-direct {v0, v1, v2, v3}, Ljava/util/concurrent/ConcurrentHashMap;-><init>(IFI)V
|
|
|
|
return-object v0
|
|
|
|
.line 3
|
|
:cond_0
|
|
invoke-static {p0}, Lcom/google/common/collect/MapMakerInternalMap;->create(Lcom/google/common/collect/MapMaker;)Lcom/google/common/collect/MapMakerInternalMap;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public setKeyStrength(Lcom/google/common/collect/MapMakerInternalMap$Strength;)Lcom/google/common/collect/MapMaker;
|
|
.locals 4
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/common/collect/MapMaker;->keyStrength:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
move v2, v1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
const-string v3, "Key strength was already set to %s"
|
|
|
|
invoke-static {v2, v3, v0}, Lcom/google/common/base/Preconditions;->checkState(ZLjava/lang/String;Ljava/lang/Object;)V
|
|
|
|
.line 2
|
|
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
iput-object v0, p0, Lcom/google/common/collect/MapMaker;->keyStrength:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
.line 3
|
|
sget-object v0, Lcom/google/common/collect/MapMakerInternalMap$Strength;->STRONG:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
if-eq p1, v0, :cond_1
|
|
|
|
.line 4
|
|
iput-boolean v1, p0, Lcom/google/common/collect/MapMaker;->useCustomMap:Z
|
|
|
|
:cond_1
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public setValueStrength(Lcom/google/common/collect/MapMakerInternalMap$Strength;)Lcom/google/common/collect/MapMaker;
|
|
.locals 4
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/common/collect/MapMaker;->valueStrength:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
move v2, v1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
const-string v3, "Value strength was already set to %s"
|
|
|
|
invoke-static {v2, v3, v0}, Lcom/google/common/base/Preconditions;->checkState(ZLjava/lang/String;Ljava/lang/Object;)V
|
|
|
|
.line 2
|
|
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
iput-object v0, p0, Lcom/google/common/collect/MapMaker;->valueStrength:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
.line 3
|
|
sget-object v0, Lcom/google/common/collect/MapMakerInternalMap$Strength;->STRONG:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
if-eq p1, v0, :cond_1
|
|
|
|
.line 4
|
|
iput-boolean v1, p0, Lcom/google/common/collect/MapMaker;->useCustomMap:Z
|
|
|
|
:cond_1
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public toString()Ljava/lang/String;
|
|
.locals 4
|
|
|
|
.line 1
|
|
invoke-static {p0}, Lcom/google/common/base/MoreObjects;->toStringHelper(Ljava/lang/Object;)Lcom/google/common/base/MoreObjects$ToStringHelper;
|
|
|
|
move-result-object v0
|
|
|
|
.line 2
|
|
iget v1, p0, Lcom/google/common/collect/MapMaker;->initialCapacity:I
|
|
|
|
const/4 v2, -0x1
|
|
|
|
if-eq v1, v2, :cond_0
|
|
|
|
const-string v3, "initialCapacity"
|
|
|
|
.line 3
|
|
invoke-virtual {v0, v3, v1}, Lcom/google/common/base/MoreObjects$ToStringHelper;->add(Ljava/lang/String;I)Lcom/google/common/base/MoreObjects$ToStringHelper;
|
|
|
|
.line 4
|
|
:cond_0
|
|
iget v1, p0, Lcom/google/common/collect/MapMaker;->concurrencyLevel:I
|
|
|
|
if-eq v1, v2, :cond_1
|
|
|
|
const-string v2, "concurrencyLevel"
|
|
|
|
.line 5
|
|
invoke-virtual {v0, v2, v1}, Lcom/google/common/base/MoreObjects$ToStringHelper;->add(Ljava/lang/String;I)Lcom/google/common/base/MoreObjects$ToStringHelper;
|
|
|
|
.line 6
|
|
:cond_1
|
|
iget-object v1, p0, Lcom/google/common/collect/MapMaker;->keyStrength:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
.line 7
|
|
invoke-virtual {v1}, Ljava/lang/Enum;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Lcom/google/common/base/Ascii;->toLowerCase(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "keyStrength"
|
|
|
|
invoke-virtual {v0, v2, v1}, Lcom/google/common/base/MoreObjects$ToStringHelper;->add(Ljava/lang/String;Ljava/lang/Object;)Lcom/google/common/base/MoreObjects$ToStringHelper;
|
|
|
|
.line 8
|
|
:cond_2
|
|
iget-object v1, p0, Lcom/google/common/collect/MapMaker;->valueStrength:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
.line 9
|
|
invoke-virtual {v1}, Ljava/lang/Enum;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Lcom/google/common/base/Ascii;->toLowerCase(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "valueStrength"
|
|
|
|
invoke-virtual {v0, v2, v1}, Lcom/google/common/base/MoreObjects$ToStringHelper;->add(Ljava/lang/String;Ljava/lang/Object;)Lcom/google/common/base/MoreObjects$ToStringHelper;
|
|
|
|
.line 10
|
|
:cond_3
|
|
iget-object v1, p0, Lcom/google/common/collect/MapMaker;->keyEquivalence:Lcom/google/common/base/Equivalence;
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
const-string v1, "keyEquivalence"
|
|
|
|
.line 11
|
|
invoke-virtual {v0, v1}, Lcom/google/common/base/MoreObjects$ToStringHelper;->addValue(Ljava/lang/Object;)Lcom/google/common/base/MoreObjects$ToStringHelper;
|
|
|
|
.line 12
|
|
:cond_4
|
|
invoke-virtual {v0}, Lcom/google/common/base/MoreObjects$ToStringHelper;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public weakKeys()Lcom/google/common/collect/MapMaker;
|
|
.locals 1
|
|
.annotation build Lcom/google/common/annotations/GwtIncompatible;
|
|
.end annotation
|
|
|
|
.annotation build Lcom/google/errorprone/annotations/CanIgnoreReturnValue;
|
|
.end annotation
|
|
|
|
.line 1
|
|
sget-object v0, Lcom/google/common/collect/MapMakerInternalMap$Strength;->WEAK:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
invoke-virtual {p0, v0}, Lcom/google/common/collect/MapMaker;->setKeyStrength(Lcom/google/common/collect/MapMakerInternalMap$Strength;)Lcom/google/common/collect/MapMaker;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public weakValues()Lcom/google/common/collect/MapMaker;
|
|
.locals 1
|
|
.annotation build Lcom/google/common/annotations/GwtIncompatible;
|
|
.end annotation
|
|
|
|
.annotation build Lcom/google/errorprone/annotations/CanIgnoreReturnValue;
|
|
.end annotation
|
|
|
|
.line 1
|
|
sget-object v0, Lcom/google/common/collect/MapMakerInternalMap$Strength;->WEAK:Lcom/google/common/collect/MapMakerInternalMap$Strength;
|
|
|
|
invoke-virtual {p0, v0}, Lcom/google/common/collect/MapMaker;->setValueStrength(Lcom/google/common/collect/MapMakerInternalMap$Strength;)Lcom/google/common/collect/MapMaker;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|