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.
205 lines
4.5 KiB
205 lines
4.5 KiB
.class public final Lcom/google/common/escape/ArrayBasedEscaperMap; |
|
.super Ljava/lang/Object; |
|
.source "ArrayBasedEscaperMap.java" |
|
|
|
|
|
# annotations |
|
.annotation build Lcom/google/common/annotations/Beta; |
|
.end annotation |
|
|
|
.annotation build Lcom/google/common/annotations/GwtCompatible; |
|
.end annotation |
|
|
|
|
|
# static fields |
|
.field private static final EMPTY_REPLACEMENT_ARRAY:[[C |
|
|
|
|
|
# instance fields |
|
.field private final replacementArray:[[C |
|
|
|
|
|
# direct methods |
|
.method static constructor <clinit>()V |
|
.locals 2 |
|
|
|
.prologue |
|
const/4 v0, 0x0 |
|
|
|
.line 90 |
|
filled-new-array {v0, v0}, [I |
|
|
|
move-result-object v0 |
|
|
|
sget-object v1, Ljava/lang/Character;->TYPE:Ljava/lang/Class; |
|
|
|
invoke-static {v1, v0}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;[I)Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, [[C |
|
|
|
sput-object v0, Lcom/google/common/escape/ArrayBasedEscaperMap;->EMPTY_REPLACEMENT_ARRAY:[[C |
|
|
|
return-void |
|
.end method |
|
|
|
.method private constructor <init>([[C)V |
|
.locals 0 |
|
|
|
.prologue |
|
.line 63 |
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V |
|
|
|
.line 64 |
|
iput-object p1, p0, Lcom/google/common/escape/ArrayBasedEscaperMap;->replacementArray:[[C |
|
|
|
.line 65 |
|
return-void |
|
.end method |
|
|
|
.method public static create(Ljava/util/Map;)Lcom/google/common/escape/ArrayBasedEscaperMap; |
|
.locals 2 |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"(", |
|
"Ljava/util/Map", |
|
"<", |
|
"Ljava/lang/Character;", |
|
"Ljava/lang/String;", |
|
">;)", |
|
"Lcom/google/common/escape/ArrayBasedEscaperMap;" |
|
} |
|
.end annotation |
|
|
|
.prologue |
|
.line 56 |
|
new-instance v0, Lcom/google/common/escape/ArrayBasedEscaperMap; |
|
|
|
invoke-static {p0}, Lcom/google/common/escape/ArrayBasedEscaperMap;->createReplacementArray(Ljava/util/Map;)[[C |
|
|
|
move-result-object v1 |
|
|
|
invoke-direct {v0, v1}, Lcom/google/common/escape/ArrayBasedEscaperMap;-><init>([[C)V |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method static createReplacementArray(Ljava/util/Map;)[[C |
|
.locals 4 |
|
.annotation build Lcom/google/common/annotations/VisibleForTesting; |
|
.end annotation |
|
|
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"(", |
|
"Ljava/util/Map", |
|
"<", |
|
"Ljava/lang/Character;", |
|
"Ljava/lang/String;", |
|
">;)[[C" |
|
} |
|
.end annotation |
|
|
|
.prologue |
|
.line 77 |
|
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; |
|
|
|
.line 78 |
|
invoke-interface {p0}, Ljava/util/Map;->isEmpty()Z |
|
|
|
move-result v0 |
|
|
|
if-eqz v0, :cond_0 |
|
|
|
.line 79 |
|
sget-object v0, Lcom/google/common/escape/ArrayBasedEscaperMap;->EMPTY_REPLACEMENT_ARRAY:[[C |
|
|
|
.line 86 |
|
:goto_0 |
|
return-object v0 |
|
|
|
.line 81 |
|
:cond_0 |
|
invoke-interface {p0}, Ljava/util/Map;->keySet()Ljava/util/Set; |
|
|
|
move-result-object v0 |
|
|
|
invoke-static {v0}, Ljava/util/Collections;->max(Ljava/util/Collection;)Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Ljava/lang/Character; |
|
|
|
invoke-virtual {v0}, Ljava/lang/Character;->charValue()C |
|
|
|
move-result v0 |
|
|
|
.line 82 |
|
add-int/lit8 v0, v0, 0x1 |
|
|
|
new-array v1, v0, [[C |
|
|
|
.line 83 |
|
invoke-interface {p0}, Ljava/util/Map;->keySet()Ljava/util/Set; |
|
|
|
move-result-object v0 |
|
|
|
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator; |
|
|
|
move-result-object v2 |
|
|
|
:goto_1 |
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z |
|
|
|
move-result v0 |
|
|
|
if-eqz v0, :cond_1 |
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Ljava/lang/Character; |
|
|
|
invoke-virtual {v0}, Ljava/lang/Character;->charValue()C |
|
|
|
move-result v3 |
|
|
|
.line 84 |
|
invoke-static {v3}, Ljava/lang/Character;->valueOf(C)Ljava/lang/Character; |
|
|
|
move-result-object v0 |
|
|
|
invoke-interface {p0, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Ljava/lang/String; |
|
|
|
invoke-virtual {v0}, Ljava/lang/String;->toCharArray()[C |
|
|
|
move-result-object v0 |
|
|
|
aput-object v0, v1, v3 |
|
|
|
goto :goto_1 |
|
|
|
:cond_1 |
|
move-object v0, v1 |
|
|
|
.line 86 |
|
goto :goto_0 |
|
.end method |
|
|
|
|
|
# virtual methods |
|
.method getReplacementArray()[[C |
|
.locals 1 |
|
|
|
.prologue |
|
.line 69 |
|
iget-object v0, p0, Lcom/google/common/escape/ArrayBasedEscaperMap;->replacementArray:[[C |
|
|
|
return-object v0 |
|
.end method
|
|
|