131 lines
3.4 KiB
Java
131 lines
3.4 KiB
Java
package o;
|
|
|
|
import android.graphics.RectF;
|
|
import java.util.ArrayList;
|
|
import java.util.Comparator;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.PriorityQueue;
|
|
|
|
/* renamed from: o.fVZ, reason: case insensitive filesystem */
|
|
/* loaded from: classes.dex */
|
|
public final class C13256fVZ {
|
|
final List<Xsy> a;
|
|
private final RVV b;
|
|
final PriorityQueue<Xsy> c;
|
|
final Object d = new Object();
|
|
final PriorityQueue<Xsy> e;
|
|
|
|
public C13256fVZ() {
|
|
RVV rvv = new RVV(this);
|
|
this.b = rvv;
|
|
this.e = new PriorityQueue<>(120, rvv);
|
|
this.c = new PriorityQueue<>(120, rvv);
|
|
this.a = new ArrayList();
|
|
}
|
|
|
|
public final void a() {
|
|
synchronized (this.d) {
|
|
this.c.addAll(this.e);
|
|
this.e.clear();
|
|
}
|
|
}
|
|
|
|
public final boolean Go_(int i, RectF rectF, int i2) {
|
|
Xsy xsy = new Xsy(i, null, rectF, false, 0);
|
|
synchronized (this.d) {
|
|
Xsy a = a(this.c, xsy);
|
|
if (a != null) {
|
|
this.c.remove(a);
|
|
a.a = i2;
|
|
this.e.offer(a);
|
|
return true;
|
|
}
|
|
return a(this.e, xsy) != null;
|
|
}
|
|
}
|
|
|
|
public final boolean Gn_(int i, RectF rectF) {
|
|
Xsy xsy = new Xsy(i, null, rectF, true, 0);
|
|
synchronized (this.a) {
|
|
Iterator<Xsy> it = this.a.iterator();
|
|
while (it.hasNext()) {
|
|
if (it.next().equals(xsy)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
private static Xsy a(PriorityQueue<Xsy> priorityQueue, Xsy xsy) {
|
|
Iterator<Xsy> it = priorityQueue.iterator();
|
|
while (it.hasNext()) {
|
|
Xsy next = it.next();
|
|
if (next.equals(xsy)) {
|
|
return next;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final List<Xsy> c() {
|
|
ArrayList arrayList;
|
|
synchronized (this.d) {
|
|
arrayList = new ArrayList(this.c);
|
|
arrayList.addAll(this.e);
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
public final List<Xsy> e() {
|
|
List<Xsy> list;
|
|
synchronized (this.a) {
|
|
list = this.a;
|
|
}
|
|
return list;
|
|
}
|
|
|
|
public final void b() {
|
|
synchronized (this.d) {
|
|
Iterator<Xsy> it = this.c.iterator();
|
|
while (it.hasNext()) {
|
|
it.next().d.recycle();
|
|
}
|
|
this.c.clear();
|
|
Iterator<Xsy> it2 = this.e.iterator();
|
|
while (it2.hasNext()) {
|
|
it2.next().d.recycle();
|
|
}
|
|
this.e.clear();
|
|
}
|
|
synchronized (this.a) {
|
|
Iterator<Xsy> it3 = this.a.iterator();
|
|
while (it3.hasNext()) {
|
|
it3.next().d.recycle();
|
|
}
|
|
this.a.clear();
|
|
}
|
|
}
|
|
|
|
/* renamed from: o.fVZ$RVV */
|
|
/* loaded from: classes.dex */
|
|
class RVV implements Comparator<Xsy> {
|
|
private C13256fVZ a;
|
|
|
|
RVV(C13256fVZ c13256fVZ) {
|
|
this.a = c13256fVZ;
|
|
}
|
|
|
|
@Override // java.util.Comparator
|
|
public final /* bridge */ /* synthetic */ int compare(Xsy xsy, Xsy xsy2) {
|
|
Xsy xsy3 = xsy;
|
|
Xsy xsy4 = xsy2;
|
|
if (xsy3.a == xsy4.a) {
|
|
return 0;
|
|
}
|
|
return xsy3.a > xsy4.a ? 1 : -1;
|
|
}
|
|
}
|
|
}
|