discord-jadx/app/src/main/java/b/f/j/c/d.java

30 lines
743 B
Java
Raw Normal View History

2021-12-21 23:37:30 +00:00
package b.f.j.c;
import java.util.LinkedHashSet;
2022-03-02 20:59:20 +00:00
/* compiled from: BoundedLinkedHashSet.java */
2022-04-12 20:58:48 +00:00
/* loaded from: classes2.dex */
2021-12-21 23:37:30 +00:00
public class d<E> {
public int a;
/* renamed from: b reason: collision with root package name */
2022-04-04 20:51:55 +00:00
public LinkedHashSet<E> f553b;
2021-12-21 23:37:30 +00:00
public d(int i) {
2022-04-04 20:51:55 +00:00
this.f553b = new LinkedHashSet<>(i);
2021-12-21 23:37:30 +00:00
this.a = i;
}
public synchronized boolean a(E e) {
2022-04-04 20:51:55 +00:00
if (this.f553b.size() == this.a) {
LinkedHashSet<E> linkedHashSet = this.f553b;
2021-12-21 23:37:30 +00:00
linkedHashSet.remove(linkedHashSet.iterator().next());
}
2022-04-04 20:51:55 +00:00
this.f553b.remove(e);
return this.f553b.add(e);
2021-12-21 23:37:30 +00:00
}
public synchronized boolean b(E e) {
2022-04-04 20:51:55 +00:00
return this.f553b.contains(e);
2021-12-21 23:37:30 +00:00
}
}