what-the-bank/sources/o/C16235maC.java

63 lines
1.6 KiB
Java

package o;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import o.OeX;
/* renamed from: o.maC, reason: case insensitive filesystem */
/* loaded from: classes2.dex */
public final class C16235maC<T extends OeX<T>> {
public boolean a;
public HBt b;
public boolean d;
public final Map<Integer, T> e = new HashMap();
public final Set<Integer> c = new HashSet();
/* renamed from: o.maC$HBt */
/* loaded from: classes2.dex */
public interface HBt {
void e();
}
public final int d() {
if (!this.a || this.c.isEmpty()) {
return -1;
}
return this.c.iterator().next().intValue();
}
public final boolean b(OeX<T> oeX) {
int id = oeX.getId();
if (this.c.contains(Integer.valueOf(id))) {
return false;
}
T t = this.e.get(Integer.valueOf(d()));
if (t != null) {
a(t, false);
}
boolean add = this.c.add(Integer.valueOf(id));
if (!oeX.isChecked()) {
oeX.setChecked(true);
}
return add;
}
public final boolean a(OeX<T> oeX, boolean z) {
int id = oeX.getId();
if (!this.c.contains(Integer.valueOf(id))) {
return false;
}
if (z && this.c.size() == 1 && this.c.contains(Integer.valueOf(id))) {
oeX.setChecked(true);
return false;
}
boolean remove = this.c.remove(Integer.valueOf(id));
if (oeX.isChecked()) {
oeX.setChecked(false);
}
return remove;
}
}