apkfuckery/com.discord/smali/com/discord/utilities/collections/LeastRecentlyAddedSet.smali

413 lines
10 KiB
Smali

.class public final Lcom/discord/utilities/collections/LeastRecentlyAddedSet;
.super Ljava/lang/Object;
.source "LeastRecentlyAddedSet.kt"
# interfaces
.implements Ljava/util/Set;
.implements Lc0/n/c/x/b;
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
"<E:",
"Ljava/lang/Object;",
">",
"Ljava/lang/Object;",
"Ljava/util/Set<",
"TE;>;",
"Ljava/lang/Object;"
}
.end annotation
# instance fields
.field public final _set:Ljava/util/LinkedHashSet;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/LinkedHashSet<",
"TE;>;"
}
.end annotation
.end field
.field public final maxSize:I
# direct methods
.method public constructor <init>()V
.locals 3
const/4 v0, 0x0
const/4 v1, 0x0
const/4 v2, 0x3
invoke-direct {p0, v0, v1, v2, v1}, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;-><init>(ILjava/util/LinkedHashSet;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
return-void
.end method
.method public constructor <init>(ILjava/util/LinkedHashSet;)V
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(I",
"Ljava/util/LinkedHashSet<",
"TE;>;)V"
}
.end annotation
const-string v0, "_set"
invoke-static {p2, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput p1, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->maxSize:I
iput-object p2, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
return-void
.end method
.method public synthetic constructor <init>(ILjava/util/LinkedHashSet;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
.locals 0
and-int/lit8 p4, p3, 0x1
if-eqz p4, :cond_0
const/4 p1, 0x3
:cond_0
and-int/lit8 p3, p3, 0x2
if-eqz p3, :cond_1
new-instance p2, Ljava/util/LinkedHashSet;
invoke-direct {p2, p1}, Ljava/util/LinkedHashSet;-><init>(I)V
:cond_1
invoke-direct {p0, p1, p2}, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;-><init>(ILjava/util/LinkedHashSet;)V
return-void
.end method
# virtual methods
.method public declared-synchronized add(Ljava/lang/Object;)Z
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(TE;)Z"
}
.end annotation
monitor-enter p0
:try_start_0
iget-object v0, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v0, p1}, Ljava/util/LinkedHashSet;->remove(Ljava/lang/Object;)Z
move-result v0
iget-object v1, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v1}, Ljava/util/LinkedHashSet;->iterator()Ljava/util/Iterator;
move-result-object v1
const-string v2, "_set.iterator()"
invoke-static {v1, v2}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
:goto_0
iget-object v2, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v2}, Ljava/util/LinkedHashSet;->size()I
move-result v2
iget v3, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->maxSize:I
if-lt v2, v3, :cond_0
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
invoke-interface {v1}, Ljava/util/Iterator;->remove()V
goto :goto_0
:cond_0
iget-object v1, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v1, p1}, Ljava/util/LinkedHashSet;->add(Ljava/lang/Object;)Z
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
xor-int/lit8 p1, v0, 0x1
monitor-exit p0
return p1
:catchall_0
move-exception p1
monitor-exit p0
throw p1
.end method
.method public addAll(Ljava/util/Collection;)Z
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Collection<",
"+TE;>;)Z"
}
.end annotation
const-string v0, "elements"
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iget-object v0, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v0, p1}, Ljava/util/LinkedHashSet;->addAll(Ljava/util/Collection;)Z
move-result p1
return p1
.end method
.method public clear()V
.locals 1
iget-object v0, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v0}, Ljava/util/LinkedHashSet;->clear()V
return-void
.end method
.method public contains(Ljava/lang/Object;)Z
.locals 1
iget-object v0, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v0, p1}, Ljava/util/LinkedHashSet;->contains(Ljava/lang/Object;)Z
move-result p1
return p1
.end method
.method public containsAll(Ljava/util/Collection;)Z
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Collection<",
"+",
"Ljava/lang/Object;",
">;)Z"
}
.end annotation
const-string v0, "elements"
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iget-object v0, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v0, p1}, Ljava/util/LinkedHashSet;->containsAll(Ljava/util/Collection;)Z
move-result p1
return p1
.end method
.method public final getMaxSize()I
.locals 1
iget v0, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->maxSize:I
return v0
.end method
.method public getSize()I
.locals 1
iget-object v0, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v0}, Ljava/util/LinkedHashSet;->size()I
move-result v0
return v0
.end method
.method public isEmpty()Z
.locals 1
iget-object v0, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v0}, Ljava/util/LinkedHashSet;->isEmpty()Z
move-result v0
return v0
.end method
.method public iterator()Ljava/util/Iterator;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/Iterator<",
"TE;>;"
}
.end annotation
iget-object v0, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v0}, Ljava/util/LinkedHashSet;->iterator()Ljava/util/Iterator;
move-result-object v0
const-string v1, "iterator(...)"
invoke-static {v0, v1}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
return-object v0
.end method
.method public remove(Ljava/lang/Object;)Z
.locals 1
iget-object v0, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v0, p1}, Ljava/util/LinkedHashSet;->remove(Ljava/lang/Object;)Z
move-result p1
return p1
.end method
.method public removeAll(Ljava/util/Collection;)Z
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Collection<",
"+",
"Ljava/lang/Object;",
">;)Z"
}
.end annotation
const-string v0, "elements"
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iget-object v0, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v0, p1}, Ljava/util/LinkedHashSet;->removeAll(Ljava/util/Collection;)Z
move-result p1
return p1
.end method
.method public retainAll(Ljava/util/Collection;)Z
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Collection<",
"+",
"Ljava/lang/Object;",
">;)Z"
}
.end annotation
const-string v0, "elements"
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iget-object v0, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-virtual {v0, p1}, Ljava/util/LinkedHashSet;->retainAll(Ljava/util/Collection;)Z
move-result p1
return p1
.end method
.method public final bridge size()I
.locals 1
invoke-virtual {p0}, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->getSize()I
move-result v0
return v0
.end method
.method public toArray()[Ljava/lang/Object;
.locals 1
invoke-static {p0}, Lc0/n/c/f;->toArray(Ljava/util/Collection;)[Ljava/lang/Object;
move-result-object v0
return-object v0
.end method
.method public toArray([Ljava/lang/Object;)[Ljava/lang/Object;
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">([TT;)[TT;"
}
.end annotation
invoke-static {p0, p1}, Lc0/n/c/f;->toArray(Ljava/util/Collection;[Ljava/lang/Object;)[Ljava/lang/Object;
move-result-object p1
return-object p1
.end method
.method public toString()Ljava/lang/String;
.locals 2
const-string v0, "LRA Set "
invoke-static {v0}, Lf/e/c/a/a;->F(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
iget-object v1, p0, Lcom/discord/utilities/collections/LeastRecentlyAddedSet;->_set:Ljava/util/LinkedHashSet;
invoke-static {v1}, Lc0/i/f;->toList(Ljava/lang/Iterable;)Ljava/util/List;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method