83 lines
3.0 KiB
Java
83 lines
3.0 KiB
Java
package o;
|
|
|
|
import java.util.NoSuchElementException;
|
|
import o.C14969gda;
|
|
|
|
/* renamed from: o.gdj, reason: case insensitive filesystem */
|
|
/* loaded from: classes.dex */
|
|
public class C14978gdj extends C14980gdl {
|
|
public static final int e(C14973gde c14973gde, AbstractC14971gdc abstractC14971gdc) {
|
|
C14957gcv.e(c14973gde, "");
|
|
C14957gcv.e(abstractC14971gdc, "");
|
|
try {
|
|
C14957gcv.e(abstractC14971gdc, "");
|
|
C14957gcv.e(c14973gde, "");
|
|
if (c14973gde.b > c14973gde.d) {
|
|
throw new IllegalArgumentException("Cannot get random in empty range: ".concat(String.valueOf(c14973gde)));
|
|
}
|
|
if (c14973gde.d < Integer.MAX_VALUE) {
|
|
return abstractC14971gdc.a(c14973gde.b, c14973gde.d + 1);
|
|
}
|
|
if (c14973gde.b > Integer.MIN_VALUE) {
|
|
return abstractC14971gdc.a(c14973gde.b - 1, c14973gde.d) + 1;
|
|
}
|
|
return abstractC14971gdc.b();
|
|
} catch (IllegalArgumentException e) {
|
|
throw new NoSuchElementException(e.getMessage());
|
|
}
|
|
}
|
|
|
|
public static final long d(C14976gdh c14976gdh, AbstractC14971gdc abstractC14971gdc) {
|
|
C14957gcv.e(c14976gdh, "");
|
|
C14957gcv.e(abstractC14971gdc, "");
|
|
try {
|
|
C14957gcv.e(abstractC14971gdc, "");
|
|
C14957gcv.e(c14976gdh, "");
|
|
if (c14976gdh.e > c14976gdh.b) {
|
|
throw new IllegalArgumentException("Cannot get random in empty range: ".concat(String.valueOf(c14976gdh)));
|
|
}
|
|
if (c14976gdh.b < Long.MAX_VALUE) {
|
|
return abstractC14971gdc.e(c14976gdh.e, c14976gdh.b + 1);
|
|
}
|
|
if (c14976gdh.e > Long.MIN_VALUE) {
|
|
return abstractC14971gdc.e(c14976gdh.e - 1, c14976gdh.b) + 1;
|
|
}
|
|
return abstractC14971gdc.e();
|
|
} catch (IllegalArgumentException e) {
|
|
throw new NoSuchElementException(e.getMessage());
|
|
}
|
|
}
|
|
|
|
public static final C14969gda b(C14969gda c14969gda, int i) {
|
|
C14957gcv.e(c14969gda, "");
|
|
boolean z = i > 0;
|
|
Integer valueOf = Integer.valueOf(i);
|
|
C14957gcv.e(valueOf, "");
|
|
if (z) {
|
|
C14969gda.RVV rvv = C14969gda.a;
|
|
int i2 = c14969gda.b;
|
|
int i3 = c14969gda.d;
|
|
if (c14969gda.e <= 0) {
|
|
i = -i;
|
|
}
|
|
return new C14969gda(i2, i3, i);
|
|
}
|
|
StringBuilder sb = new StringBuilder("Step must be positive, was: ");
|
|
sb.append(valueOf);
|
|
sb.append('.');
|
|
throw new IllegalArgumentException(sb.toString());
|
|
}
|
|
|
|
public static final int e(int i, int i2, int i3) {
|
|
if (i2 <= i3) {
|
|
return i < i2 ? i2 : i > i3 ? i3 : i;
|
|
}
|
|
StringBuilder sb = new StringBuilder("Cannot coerce value to an empty range: maximum ");
|
|
sb.append(i3);
|
|
sb.append(" is less than minimum ");
|
|
sb.append(i2);
|
|
sb.append('.');
|
|
throw new IllegalArgumentException(sb.toString());
|
|
}
|
|
}
|