2021-12-17 21:59:34 +00:00
|
|
|
package b.f.j.c;
|
|
|
|
|
|
|
|
import java.util.LinkedHashSet;
|
2022-03-07 09:34:54 +00:00
|
|
|
/* compiled from: BoundedLinkedHashSet.java */
|
2022-04-04 09:20:14 +00:00
|
|
|
/* loaded from: classes2.dex */
|
2021-12-17 21:59:34 +00:00
|
|
|
public class d<E> {
|
|
|
|
public int a;
|
|
|
|
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
2022-03-28 08:10:50 +00:00
|
|
|
public LinkedHashSet<E> f553b;
|
2021-12-17 21:59:34 +00:00
|
|
|
|
|
|
|
public d(int i) {
|
2022-03-28 08:10:50 +00:00
|
|
|
this.f553b = new LinkedHashSet<>(i);
|
2021-12-17 21:59:34 +00:00
|
|
|
this.a = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public synchronized boolean a(E e) {
|
2022-03-28 08:10:50 +00:00
|
|
|
if (this.f553b.size() == this.a) {
|
|
|
|
LinkedHashSet<E> linkedHashSet = this.f553b;
|
2021-12-17 21:59:34 +00:00
|
|
|
linkedHashSet.remove(linkedHashSet.iterator().next());
|
|
|
|
}
|
2022-03-28 08:10:50 +00:00
|
|
|
this.f553b.remove(e);
|
|
|
|
return this.f553b.add(e);
|
2021-12-17 21:59:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public synchronized boolean b(E e) {
|
2022-03-28 08:10:50 +00:00
|
|
|
return this.f553b.contains(e);
|
2021-12-17 21:59:34 +00:00
|
|
|
}
|
|
|
|
}
|