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

191 lines
5.1 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import o.Lhm;
/* loaded from: classes.dex */
public abstract class ORH<T extends Lhm> extends lsB<T> {
private List<T> b;
private float c;
private float f;
private float g;
private float i;
/* loaded from: classes.dex */
public enum IeS {
UP,
DOWN,
CLOSEST
}
public ORH(List<T> list, String str) {
super(str);
this.f = -3.4028235E38f;
this.g = Float.MAX_VALUE;
this.c = -3.4028235E38f;
this.i = Float.MAX_VALUE;
this.b = list;
if (list == null) {
this.b = new ArrayList();
}
List<T> list2 = this.b;
if (list2 == null || list2.isEmpty()) {
return;
}
this.f = -3.4028235E38f;
this.g = Float.MAX_VALUE;
this.c = -3.4028235E38f;
this.i = Float.MAX_VALUE;
Iterator<T> it = this.b.iterator();
while (it.hasNext()) {
e(it.next());
}
}
@Override // o.InterfaceC17394wQe
public final int r() {
return this.b.size();
}
public String toString() {
StringBuffer stringBuffer = new StringBuffer();
StringBuffer stringBuffer2 = new StringBuffer();
StringBuilder sb = new StringBuilder("DataSet, label: ");
sb.append(h() == null ? "" : h());
sb.append(", entries: ");
sb.append(this.b.size());
sb.append("\n");
stringBuffer2.append(sb.toString());
stringBuffer.append(stringBuffer2.toString());
for (int i = 0; i < this.b.size(); i++) {
StringBuilder sb2 = new StringBuilder();
sb2.append(this.b.get(i).toString());
sb2.append(" ");
stringBuffer.append(sb2.toString());
}
return stringBuffer.toString();
}
@Override // o.InterfaceC17394wQe
public final int a(Lhm lhm) {
return this.b.indexOf(lhm);
}
@Override // o.InterfaceC17394wQe
public final T b(float f, float f2) {
T t;
IeS ieS = IeS.CLOSEST;
List<T> list = this.b;
int i = -1;
if (list != null && !list.isEmpty()) {
int size = this.b.size() - 1;
int i2 = 0;
while (i2 < size) {
int i3 = (i2 + size) / 2;
float b = this.b.get(i3).b() - f;
int i4 = i3 + 1;
float b2 = this.b.get(i4).b();
float abs = Math.abs(b);
float abs2 = Math.abs(b2 - f);
if (abs2 >= abs) {
if (abs >= abs2) {
double d = b;
if (d < 0.0d) {
if (d < 0.0d) {
}
}
}
size = i3;
}
i2 = i4;
}
if (size != -1) {
float b3 = this.b.get(size).b();
if (ieS == IeS.UP) {
if (b3 < f && size < this.b.size() - 1) {
size++;
}
} else if (ieS == IeS.DOWN && b3 > f && size > 0) {
size--;
}
if (!Float.isNaN(f2)) {
while (size > 0 && this.b.get(size - 1).b() == b3) {
size--;
}
float f3 = this.b.get(size).e;
loop2: while (true) {
int i5 = size;
do {
i5++;
if (i5 >= this.b.size()) {
break loop2;
}
t = this.b.get(i5);
if (t.b() != b3) {
break loop2;
}
} while (Math.abs(t.e - f2) >= Math.abs(f3 - f2));
f3 = f2;
size = i5;
}
}
}
i = size;
}
if (i >= 0) {
return this.b.get(i);
}
return null;
}
@Override // o.InterfaceC17394wQe
public final T d(int i) {
return this.b.get(i);
}
protected void e(T t) {
if (t == null) {
return;
}
if (t.b() < this.i) {
this.i = t.b();
}
if (t.b() > this.c) {
this.c = t.b();
}
c(t);
}
/* JADX INFO: Access modifiers changed from: protected */
public final void c(T t) {
if (t.e < this.g) {
this.g = t.e;
}
if (t.e > this.f) {
this.f = t.e;
}
}
@Override // o.InterfaceC17394wQe
public final float y() {
return this.g;
}
@Override // o.InterfaceC17394wQe
public final float x() {
return this.f;
}
@Override // o.InterfaceC17394wQe
public final float w() {
return this.i;
}
@Override // o.InterfaceC17394wQe
public final float q() {
return this.c;
}
}