30 lines
743 B
Java
30 lines
743 B
Java
package b.f.j.c;
|
|
|
|
import java.util.LinkedHashSet;
|
|
/* compiled from: BoundedLinkedHashSet.java */
|
|
/* loaded from: classes2.dex */
|
|
public class d<E> {
|
|
public int a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public LinkedHashSet<E> f553b;
|
|
|
|
public d(int i) {
|
|
this.f553b = new LinkedHashSet<>(i);
|
|
this.a = i;
|
|
}
|
|
|
|
public synchronized boolean a(E e) {
|
|
if (this.f553b.size() == this.a) {
|
|
LinkedHashSet<E> linkedHashSet = this.f553b;
|
|
linkedHashSet.remove(linkedHashSet.iterator().next());
|
|
}
|
|
this.f553b.remove(e);
|
|
return this.f553b.add(e);
|
|
}
|
|
|
|
public synchronized boolean b(E e) {
|
|
return this.f553b.contains(e);
|
|
}
|
|
}
|