2892 lines
59 KiB
Smali
2892 lines
59 KiB
Smali
.class public final Lcom/blankj/utilcode/util/CollectionUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "CollectionUtils.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/blankj/utilcode/util/CollectionUtils$Predicate;,
|
|
Lcom/blankj/utilcode/util/CollectionUtils$Transformer;,
|
|
Lcom/blankj/utilcode/util/CollectionUtils$Closure;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method private constructor <init>()V
|
|
.locals 2
|
|
|
|
.line 30
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 31
|
|
new-instance v0, Ljava/lang/UnsupportedOperationException;
|
|
|
|
const-string v1, "u can\'t instantiate me..."
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static addAll(Ljava/util/Collection;Ljava/util/Enumeration;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;",
|
|
"Ljava/util/Enumeration<",
|
|
"TE;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 661
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Enumeration;->hasMoreElements()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 662
|
|
invoke-interface {p1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {p0, v0}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public static addAll(Ljava/util/Collection;Ljava/util/Iterator;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;",
|
|
"Ljava/util/Iterator<",
|
|
"TE;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 648
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 649
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {p0, v0}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public static addAll(Ljava/util/Collection;[Ljava/lang/Object;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;[TE;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 673
|
|
array-length v0, p1
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 674
|
|
:cond_0
|
|
invoke-static {p1}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {p0, p1}, Ljava/util/Collection;->addAll(Ljava/util/Collection;)Z
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static addIgnoreNull(Ljava/util/Collection;Ljava/lang/Object;)Z
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;TE;)Z"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 637
|
|
invoke-interface {p0, p1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:cond_1
|
|
return v0
|
|
.end method
|
|
|
|
.method public static cardinality(Ljava/lang/Object;Ljava/util/Collection;)I
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(TE;",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;)I"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
return v0
|
|
|
|
.line 420
|
|
:cond_0
|
|
instance-of v1, p1, Ljava/util/Set;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
.line 421
|
|
invoke-interface {p1, p0}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
|
|
:cond_1
|
|
if-nez p0, :cond_3
|
|
|
|
.line 425
|
|
invoke-interface {p1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_2
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 431
|
|
:cond_3
|
|
invoke-interface {p1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_4
|
|
:goto_1
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
.line 432
|
|
invoke-virtual {p0, v1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
return v0
|
|
.end method
|
|
|
|
.method public static collect(Ljava/util/Collection;Lcom/blankj/utilcode/util/CollectionUtils$Transformer;)Ljava/util/Collection;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E1:",
|
|
"Ljava/lang/Object;",
|
|
"E2:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE1;>;",
|
|
"Lcom/blankj/utilcode/util/CollectionUtils$Transformer<",
|
|
"TE1;TE2;>;)",
|
|
"Ljava/util/Collection<",
|
|
"TE2;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.line 581
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 583
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
.line 584
|
|
invoke-interface {p1, v1}, Lcom/blankj/utilcode/util/CollectionUtils$Transformer;->transform(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
:goto_1
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static containsAny(Ljava/util/Collection;Ljava/util/Collection;)Z
|
|
.locals 4
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p0, :cond_4
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 287
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v1
|
|
|
|
invoke-interface {p1}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-ge v1, v2, :cond_2
|
|
|
|
.line 288
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_1
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
.line 289
|
|
invoke-interface {p1, v1}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
return v3
|
|
|
|
.line 294
|
|
:cond_2
|
|
invoke-interface {p1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_3
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
.line 295
|
|
invoke-interface {p0, v1}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
return v3
|
|
|
|
:cond_4
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static countMatches(Ljava/util/Collection;Lcom/blankj/utilcode/util/CollectionUtils$Predicate;)I
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;",
|
|
"Lcom/blankj/utilcode/util/CollectionUtils$Predicate<",
|
|
"TE;>;)I"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 601
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_1
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
.line 602
|
|
invoke-interface {p1, v1}, Lcom/blankj/utilcode/util/CollectionUtils$Predicate;->evaluate(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
:goto_1
|
|
return v0
|
|
.end method
|
|
|
|
.method public static disjunction(Ljava/util/Collection;Ljava/util/Collection;)Ljava/util/Collection;
|
|
.locals 7
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
.line 236
|
|
new-instance p0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
if-nez p0, :cond_1
|
|
|
|
.line 237
|
|
new-instance p0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p0, p1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_1
|
|
if-nez p1, :cond_2
|
|
|
|
.line 238
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1, p0}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
return-object p1
|
|
|
|
.line 239
|
|
:cond_2
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
.line 240
|
|
invoke-static {p0}, Lcom/blankj/utilcode/util/CollectionUtils;->getCardinalityMap(Ljava/util/Collection;)Ljava/util/Map;
|
|
|
|
move-result-object v1
|
|
|
|
.line 241
|
|
invoke-static {p1}, Lcom/blankj/utilcode/util/CollectionUtils;->getCardinalityMap(Ljava/util/Collection;)Ljava/util/Map;
|
|
|
|
move-result-object v2
|
|
|
|
.line 242
|
|
new-instance v3, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v3, p0}, Ljava/util/HashSet;-><init>(Ljava/util/Collection;)V
|
|
|
|
.line 243
|
|
invoke-interface {v3, p1}, Ljava/util/Set;->addAll(Ljava/util/Collection;)Z
|
|
|
|
.line 244
|
|
invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_3
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
.line 245
|
|
invoke-static {p1, v1}, Lcom/blankj/utilcode/util/CollectionUtils;->getFreq(Ljava/lang/Object;Ljava/util/Map;)I
|
|
|
|
move-result v4
|
|
|
|
invoke-static {p1, v2}, Lcom/blankj/utilcode/util/CollectionUtils;->getFreq(Ljava/lang/Object;Ljava/util/Map;)I
|
|
|
|
move-result v5
|
|
|
|
invoke-static {v4, v5}, Ljava/lang/Math;->max(II)I
|
|
|
|
move-result v4
|
|
|
|
.line 246
|
|
invoke-static {p1, v1}, Lcom/blankj/utilcode/util/CollectionUtils;->getFreq(Ljava/lang/Object;Ljava/util/Map;)I
|
|
|
|
move-result v5
|
|
|
|
invoke-static {p1, v2}, Lcom/blankj/utilcode/util/CollectionUtils;->getFreq(Ljava/lang/Object;Ljava/util/Map;)I
|
|
|
|
move-result v6
|
|
|
|
invoke-static {v5, v6}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result v5
|
|
|
|
sub-int/2addr v4, v5
|
|
|
|
:goto_0
|
|
if-ge v3, v4, :cond_3
|
|
|
|
.line 247
|
|
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static exists(Ljava/util/Collection;Lcom/blankj/utilcode/util/CollectionUtils$Predicate;)Z
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;",
|
|
"Lcom/blankj/utilcode/util/CollectionUtils$Predicate<",
|
|
"TE;>;)Z"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 620
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_1
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
.line 621
|
|
invoke-interface {p1, v1}, Lcom/blankj/utilcode/util/CollectionUtils$Predicate;->evaluate(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:cond_2
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static filter(Ljava/util/Collection;Lcom/blankj/utilcode/util/CollectionUtils$Predicate;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;",
|
|
"Lcom/blankj/utilcode/util/CollectionUtils$Predicate<",
|
|
"TE;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 487
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_1
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 488
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {p1, v0}, Lcom/blankj/utilcode/util/CollectionUtils$Predicate;->evaluate(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
.line 489
|
|
invoke-interface {p0}, Ljava/util/Iterator;->remove()V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public static find(Ljava/util/Collection;Lcom/blankj/utilcode/util/CollectionUtils$Predicate;)Ljava/lang/Object;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;",
|
|
"Lcom/blankj/utilcode/util/CollectionUtils$Predicate<",
|
|
"TE;>;)TE;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 452
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_1
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
.line 453
|
|
invoke-interface {p1, v1}, Lcom/blankj/utilcode/util/CollectionUtils$Predicate;->evaluate(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
return-object v1
|
|
|
|
:cond_2
|
|
:goto_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static forAllDo(Ljava/util/Collection;Lcom/blankj/utilcode/util/CollectionUtils$Closure;)V
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;",
|
|
"Lcom/blankj/utilcode/util/CollectionUtils$Closure<",
|
|
"TE;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
.line 471
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
add-int/lit8 v2, v0, 0x1
|
|
|
|
.line 472
|
|
invoke-interface {p1, v0, v1}, Lcom/blankj/utilcode/util/CollectionUtils$Closure;->execute(ILjava/lang/Object;)V
|
|
|
|
move v0, v2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public static get(Ljava/lang/Object;I)Ljava/lang/Object;
|
|
.locals 3
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
if-ltz p1, :cond_b
|
|
|
|
.line 712
|
|
instance-of v0, p0, Ljava/util/Map;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 713
|
|
check-cast p0, Ljava/util/Map;
|
|
|
|
.line 714
|
|
invoke-interface {p0}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-interface {p0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
.line 715
|
|
invoke-static {p0, p1}, Lcom/blankj/utilcode/util/CollectionUtils;->get(Ljava/lang/Object;I)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 716
|
|
:cond_1
|
|
instance-of v0, p0, Ljava/util/List;
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 717
|
|
check-cast p0, Ljava/util/List;
|
|
|
|
invoke-interface {p0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 718
|
|
:cond_2
|
|
instance-of v0, p0, [Ljava/lang/Object;
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
.line 719
|
|
check-cast p0, [Ljava/lang/Object;
|
|
|
|
check-cast p0, [Ljava/lang/Object;
|
|
|
|
aget-object p0, p0, p1
|
|
|
|
return-object p0
|
|
|
|
.line 720
|
|
:cond_3
|
|
instance-of v0, p0, Ljava/util/Iterator;
|
|
|
|
const-string v1, "Entry does not exist: "
|
|
|
|
const/4 v2, -0x1
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
.line 721
|
|
check-cast p0, Ljava/util/Iterator;
|
|
|
|
.line 722
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
add-int/lit8 p1, p1, -0x1
|
|
|
|
if-ne p1, v2, :cond_4
|
|
|
|
.line 725
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 727
|
|
:cond_4
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
.line 730
|
|
:cond_5
|
|
new-instance p0, Ljava/lang/IndexOutOfBoundsException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
.line 731
|
|
:cond_6
|
|
instance-of v0, p0, Ljava/util/Collection;
|
|
|
|
if-eqz v0, :cond_7
|
|
|
|
.line 732
|
|
check-cast p0, Ljava/util/Collection;
|
|
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
.line 733
|
|
invoke-static {p0, p1}, Lcom/blankj/utilcode/util/CollectionUtils;->get(Ljava/lang/Object;I)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 734
|
|
:cond_7
|
|
instance-of v0, p0, Ljava/util/Enumeration;
|
|
|
|
if-eqz v0, :cond_a
|
|
|
|
.line 735
|
|
check-cast p0, Ljava/util/Enumeration;
|
|
|
|
.line 736
|
|
:goto_1
|
|
invoke-interface {p0}, Ljava/util/Enumeration;->hasMoreElements()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_9
|
|
|
|
add-int/lit8 p1, p1, -0x1
|
|
|
|
if-ne p1, v2, :cond_8
|
|
|
|
.line 739
|
|
invoke-interface {p0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 741
|
|
:cond_8
|
|
invoke-interface {p0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;
|
|
|
|
goto :goto_1
|
|
|
|
.line 744
|
|
:cond_9
|
|
new-instance p0, Ljava/lang/IndexOutOfBoundsException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
.line 747
|
|
:cond_a
|
|
:try_start_0
|
|
invoke-static {p0, p1}, Ljava/lang/reflect/Array;->get(Ljava/lang/Object;I)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
.line 749
|
|
:catch_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "Unsupported object type: "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 710
|
|
:cond_b
|
|
new-instance p0, Ljava/lang/IndexOutOfBoundsException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "Index cannot be negative: "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static getCardinalityMap(Ljava/util/Collection;)Ljava/util/Map;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Collection;",
|
|
")",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Object;",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
.line 316
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
.line 318
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
.line 319
|
|
invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/Integer;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
.line 321
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
.line 323
|
|
:cond_1
|
|
invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v2
|
|
|
|
add-int/2addr v2, v3
|
|
|
|
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private static getFreq(Ljava/lang/Object;Ljava/util/Map;)I
|
|
.locals 0
|
|
|
|
.line 211
|
|
invoke-interface {p1, p0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Ljava/lang/Integer;
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 213
|
|
invoke-virtual {p0}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static intersection(Ljava/util/Collection;Ljava/util/Collection;)Ljava/util/Collection;
|
|
.locals 6
|
|
|
|
if-eqz p0, :cond_3
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 197
|
|
:cond_0
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
.line 198
|
|
invoke-static {p0}, Lcom/blankj/utilcode/util/CollectionUtils;->getCardinalityMap(Ljava/util/Collection;)Ljava/util/Map;
|
|
|
|
move-result-object v1
|
|
|
|
.line 199
|
|
invoke-static {p1}, Lcom/blankj/utilcode/util/CollectionUtils;->getCardinalityMap(Ljava/util/Collection;)Ljava/util/Map;
|
|
|
|
move-result-object v2
|
|
|
|
.line 200
|
|
new-instance v3, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v3, p0}, Ljava/util/HashSet;-><init>(Ljava/util/Collection;)V
|
|
|
|
.line 201
|
|
invoke-interface {v3, p1}, Ljava/util/Set;->addAll(Ljava/util/Collection;)Z
|
|
|
|
.line 202
|
|
invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_1
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
.line 203
|
|
invoke-static {p1, v1}, Lcom/blankj/utilcode/util/CollectionUtils;->getFreq(Ljava/lang/Object;Ljava/util/Map;)I
|
|
|
|
move-result v4
|
|
|
|
invoke-static {p1, v2}, Lcom/blankj/utilcode/util/CollectionUtils;->getFreq(Ljava/lang/Object;Ljava/util/Map;)I
|
|
|
|
move-result v5
|
|
|
|
invoke-static {v4, v5}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result v4
|
|
|
|
:goto_0
|
|
if-ge v3, v4, :cond_1
|
|
|
|
.line 204
|
|
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
return-object v0
|
|
|
|
.line 196
|
|
:cond_3
|
|
:goto_1
|
|
new-instance p0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static isEmpty(Ljava/util/Collection;)Z
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
.line 850
|
|
invoke-interface {p0}, Ljava/util/Collection;->size()I
|
|
|
|
move-result p0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 p0, 0x1
|
|
|
|
:goto_1
|
|
return p0
|
|
.end method
|
|
|
|
.method public static isEqualCollection(Ljava/util/Collection;Ljava/util/Collection;)Z
|
|
.locals 4
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p0, :cond_5
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 393
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v1
|
|
|
|
invoke-interface {p1}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v2
|
|
|
|
if-eq v1, v2, :cond_1
|
|
|
|
return v0
|
|
|
|
.line 396
|
|
:cond_1
|
|
invoke-static {p0}, Lcom/blankj/utilcode/util/CollectionUtils;->getCardinalityMap(Ljava/util/Collection;)Ljava/util/Map;
|
|
|
|
move-result-object p0
|
|
|
|
.line 397
|
|
invoke-static {p1}, Lcom/blankj/utilcode/util/CollectionUtils;->getCardinalityMap(Ljava/util/Collection;)Ljava/util/Map;
|
|
|
|
move-result-object p1
|
|
|
|
.line 398
|
|
invoke-interface {p0}, Ljava/util/Map;->size()I
|
|
|
|
move-result v1
|
|
|
|
invoke-interface {p1}, Ljava/util/Map;->size()I
|
|
|
|
move-result v2
|
|
|
|
if-eq v1, v2, :cond_2
|
|
|
|
return v0
|
|
|
|
.line 401
|
|
:cond_2
|
|
invoke-interface {p0}, Ljava/util/Map;->keySet()Ljava/util/Set;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:cond_3
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
.line 402
|
|
invoke-static {v2, p0}, Lcom/blankj/utilcode/util/CollectionUtils;->getFreq(Ljava/lang/Object;Ljava/util/Map;)I
|
|
|
|
move-result v3
|
|
|
|
invoke-static {v2, p1}, Lcom/blankj/utilcode/util/CollectionUtils;->getFreq(Ljava/lang/Object;Ljava/util/Map;)I
|
|
|
|
move-result v2
|
|
|
|
if-eq v3, v2, :cond_3
|
|
|
|
return v0
|
|
|
|
:cond_4
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:cond_5
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static isNotEmpty(Ljava/util/Collection;)Z
|
|
.locals 0
|
|
|
|
.line 862
|
|
invoke-static {p0}, Lcom/blankj/utilcode/util/CollectionUtils;->isEmpty(Ljava/util/Collection;)Z
|
|
|
|
move-result p0
|
|
|
|
xor-int/lit8 p0, p0, 0x1
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static isProperSubCollection(Ljava/util/Collection;Ljava/util/Collection;)Z
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 376
|
|
:cond_0
|
|
invoke-interface {p0}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v1
|
|
|
|
invoke-interface {p1}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v2
|
|
|
|
if-ge v1, v2, :cond_1
|
|
|
|
invoke-static {p0, p1}, Lcom/blankj/utilcode/util/CollectionUtils;->isSubCollection(Ljava/util/Collection;Ljava/util/Collection;)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static isSubCollection(Ljava/util/Collection;Ljava/util/Collection;)Z
|
|
.locals 4
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p0, :cond_3
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 343
|
|
:cond_0
|
|
invoke-static {p0}, Lcom/blankj/utilcode/util/CollectionUtils;->getCardinalityMap(Ljava/util/Collection;)Ljava/util/Map;
|
|
|
|
move-result-object v1
|
|
|
|
.line 344
|
|
invoke-static {p1}, Lcom/blankj/utilcode/util/CollectionUtils;->getCardinalityMap(Ljava/util/Collection;)Ljava/util/Map;
|
|
|
|
move-result-object p1
|
|
|
|
.line 345
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_1
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
.line 346
|
|
invoke-static {v2, v1}, Lcom/blankj/utilcode/util/CollectionUtils;->getFreq(Ljava/lang/Object;Ljava/util/Map;)I
|
|
|
|
move-result v3
|
|
|
|
invoke-static {v2, p1}, Lcom/blankj/utilcode/util/CollectionUtils;->getFreq(Ljava/lang/Object;Ljava/util/Map;)I
|
|
|
|
move-result v2
|
|
|
|
if-le v3, v2, :cond_1
|
|
|
|
return v0
|
|
|
|
:cond_2
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:cond_3
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static varargs newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">([TE;)",
|
|
"Ljava/util/ArrayList<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljava/lang/SafeVarargs;
|
|
.end annotation
|
|
|
|
.line 62
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
.line 63
|
|
array-length v1, p0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 64
|
|
:cond_0
|
|
array-length v1, p0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_1
|
|
|
|
aget-object v3, p0, v2
|
|
|
|
.line 65
|
|
invoke-virtual {v0, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
:goto_1
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static varargs newArrayListNotNull([Ljava/lang/Object;)Ljava/util/ArrayList;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">([TE;)",
|
|
"Ljava/util/ArrayList<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljava/lang/SafeVarargs;
|
|
.end annotation
|
|
|
|
.line 72
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
.line 73
|
|
array-length v1, p0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
goto :goto_2
|
|
|
|
.line 74
|
|
:cond_0
|
|
array-length v1, p0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_2
|
|
|
|
aget-object v3, p0, v2
|
|
|
|
if-nez v3, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
.line 76
|
|
:cond_1
|
|
invoke-virtual {v0, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
:goto_1
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
:goto_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static varargs newHashSet([Ljava/lang/Object;)Ljava/util/HashSet;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">([TE;)",
|
|
"Ljava/util/HashSet<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljava/lang/SafeVarargs;
|
|
.end annotation
|
|
|
|
.line 104
|
|
new-instance v0, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashSet;-><init>()V
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
.line 105
|
|
array-length v1, p0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 106
|
|
:cond_0
|
|
array-length v1, p0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_1
|
|
|
|
aget-object v3, p0, v2
|
|
|
|
.line 107
|
|
invoke-virtual {v0, v3}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
:goto_1
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static varargs newHashSetNotNull([Ljava/lang/Object;)Ljava/util/HashSet;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">([TE;)",
|
|
"Ljava/util/HashSet<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljava/lang/SafeVarargs;
|
|
.end annotation
|
|
|
|
.line 114
|
|
new-instance v0, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashSet;-><init>()V
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
.line 115
|
|
array-length v1, p0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
goto :goto_2
|
|
|
|
.line 116
|
|
:cond_0
|
|
array-length v1, p0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_2
|
|
|
|
aget-object v3, p0, v2
|
|
|
|
if-nez v3, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
.line 118
|
|
:cond_1
|
|
invoke-virtual {v0, v3}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z
|
|
|
|
:goto_1
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
:goto_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static varargs newLinkedList([Ljava/lang/Object;)Ljava/util/LinkedList;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">([TE;)",
|
|
"Ljava/util/LinkedList<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljava/lang/SafeVarargs;
|
|
.end annotation
|
|
|
|
.line 83
|
|
new-instance v0, Ljava/util/LinkedList;
|
|
|
|
invoke-direct {v0}, Ljava/util/LinkedList;-><init>()V
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
.line 84
|
|
array-length v1, p0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 85
|
|
:cond_0
|
|
array-length v1, p0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_1
|
|
|
|
aget-object v3, p0, v2
|
|
|
|
.line 86
|
|
invoke-virtual {v0, v3}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
:goto_1
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static varargs newLinkedListNotNull([Ljava/lang/Object;)Ljava/util/LinkedList;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">([TE;)",
|
|
"Ljava/util/LinkedList<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljava/lang/SafeVarargs;
|
|
.end annotation
|
|
|
|
.line 93
|
|
new-instance v0, Ljava/util/LinkedList;
|
|
|
|
invoke-direct {v0}, Ljava/util/LinkedList;-><init>()V
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
.line 94
|
|
array-length v1, p0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
goto :goto_2
|
|
|
|
.line 95
|
|
:cond_0
|
|
array-length v1, p0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_2
|
|
|
|
aget-object v3, p0, v2
|
|
|
|
if-nez v3, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
.line 97
|
|
:cond_1
|
|
invoke-virtual {v0, v3}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z
|
|
|
|
:goto_1
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
:goto_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static newSynchronizedCollection(Ljava/util/Collection;)Ljava/util/Collection;
|
|
.locals 0
|
|
|
|
.line 145
|
|
invoke-static {p0}, Ljava/util/Collections;->synchronizedCollection(Ljava/util/Collection;)Ljava/util/Collection;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static varargs newTreeSet(Ljava/util/Comparator;[Ljava/lang/Object;)Ljava/util/TreeSet;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Comparator<",
|
|
"TE;>;[TE;)",
|
|
"Ljava/util/TreeSet<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljava/lang/SafeVarargs;
|
|
.end annotation
|
|
|
|
.line 125
|
|
new-instance v0, Ljava/util/TreeSet;
|
|
|
|
invoke-direct {v0, p0}, Ljava/util/TreeSet;-><init>(Ljava/util/Comparator;)V
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 126
|
|
array-length p0, p1
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 127
|
|
:cond_0
|
|
array-length p0, p1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
if-ge v1, p0, :cond_1
|
|
|
|
aget-object v2, p1, v1
|
|
|
|
.line 128
|
|
invoke-virtual {v0, v2}, Ljava/util/TreeSet;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
:goto_1
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static varargs newTreeSetNotNull(Ljava/util/Comparator;[Ljava/lang/Object;)Ljava/util/TreeSet;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Comparator<",
|
|
"TE;>;[TE;)",
|
|
"Ljava/util/TreeSet<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljava/lang/SafeVarargs;
|
|
.end annotation
|
|
|
|
.line 135
|
|
new-instance v0, Ljava/util/TreeSet;
|
|
|
|
invoke-direct {v0, p0}, Ljava/util/TreeSet;-><init>(Ljava/util/Comparator;)V
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
.line 136
|
|
array-length p0, p1
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
goto :goto_2
|
|
|
|
.line 137
|
|
:cond_0
|
|
array-length p0, p1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
if-ge v1, p0, :cond_2
|
|
|
|
aget-object v2, p1, v1
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
.line 139
|
|
:cond_1
|
|
invoke-virtual {v0, v2}, Ljava/util/TreeSet;->add(Ljava/lang/Object;)Z
|
|
|
|
:goto_1
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
:goto_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static newUnmodifiableCollection(Ljava/util/Collection;)Ljava/util/Collection;
|
|
.locals 0
|
|
|
|
.line 149
|
|
invoke-static {p0}, Ljava/util/Collections;->unmodifiableCollection(Ljava/util/Collection;)Ljava/util/Collection;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static varargs newUnmodifiableList([Ljava/lang/Object;)Ljava/util/List;
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">([TE;)",
|
|
"Ljava/util/List<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljava/lang/SafeVarargs;
|
|
.end annotation
|
|
|
|
.line 46
|
|
invoke-static {p0}, Lcom/blankj/utilcode/util/CollectionUtils;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static varargs newUnmodifiableListNotNull([Ljava/lang/Object;)Ljava/util/List;
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">([TE;)",
|
|
"Ljava/util/List<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation runtime Ljava/lang/SafeVarargs;
|
|
.end annotation
|
|
|
|
.line 57
|
|
invoke-static {p0}, Lcom/blankj/utilcode/util/CollectionUtils;->newArrayListNotNull([Ljava/lang/Object;)Ljava/util/ArrayList;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static removeAll(Ljava/util/Collection;Ljava/util/Collection;)Ljava/util/Collection;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;)",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
.line 905
|
|
new-instance p0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
if-nez p1, :cond_1
|
|
|
|
.line 906
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1, p0}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
return-object p1
|
|
|
|
.line 907
|
|
:cond_1
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
.line 908
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_2
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
.line 909
|
|
invoke-interface {p1, v1}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_2
|
|
|
|
.line 910
|
|
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static retainAll(Ljava/util/Collection;Ljava/util/Collection;)Ljava/util/Collection;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;)",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_3
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 881
|
|
:cond_0
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
.line 882
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_1
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
.line 883
|
|
invoke-interface {p1, v1}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 884
|
|
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
return-object v0
|
|
|
|
.line 880
|
|
:cond_3
|
|
:goto_1
|
|
new-instance p0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static select(Ljava/util/Collection;Lcom/blankj/utilcode/util/CollectionUtils$Predicate;)Ljava/util/Collection;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;",
|
|
"Lcom/blankj/utilcode/util/CollectionUtils$Predicate<",
|
|
"TE;>;)",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_3
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 507
|
|
:cond_0
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-interface {p0}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
.line 508
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_1
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
.line 509
|
|
invoke-interface {p1, v1}, Lcom/blankj/utilcode/util/CollectionUtils$Predicate;->evaluate(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 510
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
return-object v0
|
|
|
|
.line 506
|
|
:cond_3
|
|
:goto_1
|
|
new-instance p0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static selectRejected(Ljava/util/Collection;Lcom/blankj/utilcode/util/CollectionUtils$Predicate;)Ljava/util/Collection;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;",
|
|
"Lcom/blankj/utilcode/util/CollectionUtils$Predicate<",
|
|
"TE;>;)",
|
|
"Ljava/util/Collection<",
|
|
"TE;>;"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_3
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 529
|
|
:cond_0
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-interface {p0}, Ljava/util/Collection;->size()I
|
|
|
|
move-result v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
.line 530
|
|
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_1
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
.line 531
|
|
invoke-interface {p1, v1}, Lcom/blankj/utilcode/util/CollectionUtils$Predicate;->evaluate(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
.line 532
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
return-object v0
|
|
|
|
.line 528
|
|
:cond_3
|
|
:goto_1
|
|
new-instance p0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static shuffle(Ljava/util/List;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/List<",
|
|
"TT;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 924
|
|
invoke-static {p0}, Ljava/util/Collections;->shuffle(Ljava/util/List;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static size(Ljava/lang/Object;)I
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
return v0
|
|
|
|
.line 773
|
|
:cond_0
|
|
instance-of v1, p0, Ljava/util/Map;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
.line 774
|
|
check-cast p0, Ljava/util/Map;
|
|
|
|
invoke-interface {p0}, Ljava/util/Map;->size()I
|
|
|
|
move-result p0
|
|
|
|
goto :goto_2
|
|
|
|
.line 775
|
|
:cond_1
|
|
instance-of v1, p0, Ljava/util/Collection;
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
.line 776
|
|
check-cast p0, Ljava/util/Collection;
|
|
|
|
invoke-interface {p0}, Ljava/util/Collection;->size()I
|
|
|
|
move-result p0
|
|
|
|
goto :goto_2
|
|
|
|
.line 777
|
|
:cond_2
|
|
instance-of v1, p0, [Ljava/lang/Object;
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
.line 778
|
|
check-cast p0, [Ljava/lang/Object;
|
|
|
|
check-cast p0, [Ljava/lang/Object;
|
|
|
|
array-length p0, p0
|
|
|
|
goto :goto_2
|
|
|
|
.line 779
|
|
:cond_3
|
|
instance-of v1, p0, Ljava/util/Iterator;
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
.line 780
|
|
check-cast p0, Ljava/util/Iterator;
|
|
|
|
.line 781
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
.line 783
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
move p0, v0
|
|
|
|
goto :goto_2
|
|
|
|
.line 785
|
|
:cond_5
|
|
instance-of v1, p0, Ljava/util/Enumeration;
|
|
|
|
if-eqz v1, :cond_6
|
|
|
|
.line 786
|
|
check-cast p0, Ljava/util/Enumeration;
|
|
|
|
.line 787
|
|
:goto_1
|
|
invoke-interface {p0}, Ljava/util/Enumeration;->hasMoreElements()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
.line 789
|
|
invoke-interface {p0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;
|
|
|
|
goto :goto_1
|
|
|
|
.line 793
|
|
:cond_6
|
|
:try_start_0
|
|
invoke-static {p0}, Ljava/lang/reflect/Array;->getLength(Ljava/lang/Object;)I
|
|
|
|
move-result p0
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:goto_2
|
|
return p0
|
|
|
|
.line 795
|
|
:catch_0
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "Unsupported object type: "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static sizeIsEmpty(Ljava/lang/Object;)Z
|
|
.locals 3
|
|
|
|
const/4 v0, 0x1
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
return v0
|
|
|
|
.line 822
|
|
:cond_0
|
|
instance-of v1, p0, Ljava/util/Collection;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
.line 823
|
|
check-cast p0, Ljava/util/Collection;
|
|
|
|
invoke-interface {p0}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
|
|
.line 824
|
|
:cond_1
|
|
instance-of v1, p0, Ljava/util/Map;
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
.line 825
|
|
check-cast p0, Ljava/util/Map;
|
|
|
|
invoke-interface {p0}, Ljava/util/Map;->isEmpty()Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
|
|
.line 826
|
|
:cond_2
|
|
instance-of v1, p0, [Ljava/lang/Object;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
.line 827
|
|
check-cast p0, [Ljava/lang/Object;
|
|
|
|
check-cast p0, [Ljava/lang/Object;
|
|
|
|
array-length p0, p0
|
|
|
|
if-nez p0, :cond_3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
move v0, v2
|
|
|
|
:goto_0
|
|
return v0
|
|
|
|
.line 828
|
|
:cond_4
|
|
instance-of v1, p0, Ljava/util/Iterator;
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
.line 829
|
|
check-cast p0, Ljava/util/Iterator;
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result p0
|
|
|
|
xor-int/2addr p0, v0
|
|
|
|
return p0
|
|
|
|
.line 830
|
|
:cond_5
|
|
instance-of v1, p0, Ljava/util/Enumeration;
|
|
|
|
if-eqz v1, :cond_6
|
|
|
|
.line 831
|
|
check-cast p0, Ljava/util/Enumeration;
|
|
|
|
invoke-interface {p0}, Ljava/util/Enumeration;->hasMoreElements()Z
|
|
|
|
move-result p0
|
|
|
|
xor-int/2addr p0, v0
|
|
|
|
return p0
|
|
|
|
.line 834
|
|
:cond_6
|
|
:try_start_0
|
|
invoke-static {p0}, Ljava/lang/reflect/Array;->getLength(Ljava/lang/Object;)I
|
|
|
|
move-result p0
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
if-nez p0, :cond_7
|
|
|
|
goto :goto_1
|
|
|
|
:cond_7
|
|
move v0, v2
|
|
|
|
:goto_1
|
|
return v0
|
|
|
|
.line 836
|
|
:catch_0
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "Unsupported object type: "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static subtract(Ljava/util/Collection;Ljava/util/Collection;)Ljava/util/Collection;
|
|
.locals 1
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
.line 265
|
|
new-instance p0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
if-nez p1, :cond_1
|
|
|
|
.line 266
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1, p0}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
return-object p1
|
|
|
|
.line 267
|
|
:cond_1
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0, p0}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
.line 268
|
|
invoke-interface {p1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
.line 269
|
|
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static toString(Ljava/util/Collection;)Ljava/lang/String;
|
|
.locals 0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
const-string p0, "null"
|
|
|
|
return-object p0
|
|
|
|
.line 935
|
|
:cond_0
|
|
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static transform(Ljava/util/Collection;Lcom/blankj/utilcode/util/CollectionUtils$Transformer;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<E1:",
|
|
"Ljava/lang/Object;",
|
|
"E2:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/util/Collection<",
|
|
"TE1;>;",
|
|
"Lcom/blankj/utilcode/util/CollectionUtils$Transformer<",
|
|
"TE1;TE2;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 556
|
|
:cond_0
|
|
instance-of v0, p0, Ljava/util/List;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 557
|
|
check-cast p0, Ljava/util/List;
|
|
|
|
.line 558
|
|
invoke-interface {p0}, Ljava/util/List;->listIterator()Ljava/util/ListIterator;
|
|
|
|
move-result-object p0
|
|
|
|
:goto_0
|
|
invoke-interface {p0}, Ljava/util/ListIterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 559
|
|
invoke-interface {p0}, Ljava/util/ListIterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {p1, v0}, Lcom/blankj/utilcode/util/CollectionUtils$Transformer;->transform(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {p0, v0}, Ljava/util/ListIterator;->set(Ljava/lang/Object;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 562
|
|
:cond_1
|
|
invoke-static {p0, p1}, Lcom/blankj/utilcode/util/CollectionUtils;->collect(Ljava/util/Collection;Lcom/blankj/utilcode/util/CollectionUtils$Transformer;)Ljava/util/Collection;
|
|
|
|
move-result-object p1
|
|
|
|
.line 563
|
|
invoke-interface {p0}, Ljava/util/Collection;->clear()V
|
|
|
|
.line 564
|
|
invoke-interface {p0, p1}, Ljava/util/Collection;->addAll(Ljava/util/Collection;)Z
|
|
|
|
:cond_2
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public static union(Ljava/util/Collection;Ljava/util/Collection;)Ljava/util/Collection;
|
|
.locals 6
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
.line 166
|
|
new-instance p0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
if-nez p0, :cond_1
|
|
|
|
.line 167
|
|
new-instance p0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p0, p1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
return-object p0
|
|
|
|
:cond_1
|
|
if-nez p1, :cond_2
|
|
|
|
.line 168
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1, p0}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
return-object p1
|
|
|
|
.line 169
|
|
:cond_2
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
.line 170
|
|
invoke-static {p0}, Lcom/blankj/utilcode/util/CollectionUtils;->getCardinalityMap(Ljava/util/Collection;)Ljava/util/Map;
|
|
|
|
move-result-object v1
|
|
|
|
.line 171
|
|
invoke-static {p1}, Lcom/blankj/utilcode/util/CollectionUtils;->getCardinalityMap(Ljava/util/Collection;)Ljava/util/Map;
|
|
|
|
move-result-object v2
|
|
|
|
.line 172
|
|
new-instance v3, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v3, p0}, Ljava/util/HashSet;-><init>(Ljava/util/Collection;)V
|
|
|
|
.line 173
|
|
invoke-interface {v3, p1}, Ljava/util/Set;->addAll(Ljava/util/Collection;)Z
|
|
|
|
.line 174
|
|
invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p0
|
|
|
|
:cond_3
|
|
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
.line 175
|
|
invoke-static {p1, v1}, Lcom/blankj/utilcode/util/CollectionUtils;->getFreq(Ljava/lang/Object;Ljava/util/Map;)I
|
|
|
|
move-result v4
|
|
|
|
invoke-static {p1, v2}, Lcom/blankj/utilcode/util/CollectionUtils;->getFreq(Ljava/lang/Object;Ljava/util/Map;)I
|
|
|
|
move-result v5
|
|
|
|
invoke-static {v4, v5}, Ljava/lang/Math;->max(II)I
|
|
|
|
move-result v4
|
|
|
|
:goto_0
|
|
if-ge v3, v4, :cond_3
|
|
|
|
.line 176
|
|
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
return-object v0
|
|
.end method
|