Initial commit
This commit is contained in:
19
sources/androidx/core/util/DebugUtils.java
Normal file
19
sources/androidx/core/util/DebugUtils.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package androidx.core.util;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DebugUtils {
|
||||
public static void a(Object obj, StringBuilder sb) {
|
||||
int lastIndexOf;
|
||||
if (obj == null) {
|
||||
sb.append("null");
|
||||
return;
|
||||
}
|
||||
String simpleName = obj.getClass().getSimpleName();
|
||||
if ((simpleName == null || simpleName.length() <= 0) && (lastIndexOf = (simpleName = obj.getClass().getName()).lastIndexOf(46)) > 0) {
|
||||
simpleName = simpleName.substring(lastIndexOf + 1);
|
||||
}
|
||||
sb.append(simpleName);
|
||||
sb.append('{');
|
||||
sb.append(Integer.toHexString(System.identityHashCode(obj)));
|
||||
}
|
||||
}
|
45
sources/androidx/core/util/LogWriter.java
Normal file
45
sources/androidx/core/util/LogWriter.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package androidx.core.util;
|
||||
|
||||
import android.util.Log;
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
import java.io.Writer;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class LogWriter extends Writer {
|
||||
private final String a;
|
||||
private StringBuilder b = new StringBuilder(PeripheralType.SERVO);
|
||||
|
||||
public LogWriter(String str) {
|
||||
this.a = str;
|
||||
}
|
||||
|
||||
private void a() {
|
||||
if (this.b.length() > 0) {
|
||||
Log.d(this.a, this.b.toString());
|
||||
StringBuilder sb = this.b;
|
||||
sb.delete(0, sb.length());
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.io.Writer, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
a();
|
||||
}
|
||||
|
||||
@Override // java.io.Writer, java.io.Flushable
|
||||
public void flush() {
|
||||
a();
|
||||
}
|
||||
|
||||
@Override // java.io.Writer
|
||||
public void write(char[] cArr, int i, int i2) {
|
||||
for (int i3 = 0; i3 < i2; i3++) {
|
||||
char c = cArr[i + i3];
|
||||
if (c == '\n') {
|
||||
a();
|
||||
} else {
|
||||
this.b.append(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
19
sources/androidx/core/util/ObjectsCompat.java
Normal file
19
sources/androidx/core/util/ObjectsCompat.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package androidx.core.util;
|
||||
|
||||
import android.os.Build;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ObjectsCompat {
|
||||
public static boolean a(Object obj, Object obj2) {
|
||||
return Build.VERSION.SDK_INT >= 19 ? Objects.equals(obj, obj2) : obj == obj2 || (obj != null && obj.equals(obj2));
|
||||
}
|
||||
|
||||
public static int a(Object... objArr) {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
return Objects.hash(objArr);
|
||||
}
|
||||
return Arrays.hashCode(objArr);
|
||||
}
|
||||
}
|
35
sources/androidx/core/util/Pair.java
Normal file
35
sources/androidx/core/util/Pair.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package androidx.core.util;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Pair<F, S> {
|
||||
public final F a;
|
||||
public final S b;
|
||||
|
||||
public Pair(F f, S s) {
|
||||
this.a = f;
|
||||
this.b = s;
|
||||
}
|
||||
|
||||
public static <A, B> Pair<A, B> a(A a, B b) {
|
||||
return new Pair<>(a, b);
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof Pair)) {
|
||||
return false;
|
||||
}
|
||||
Pair pair = (Pair) obj;
|
||||
return ObjectsCompat.a(pair.a, this.a) && ObjectsCompat.a(pair.b, this.b);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
F f = this.a;
|
||||
int hashCode = f == null ? 0 : f.hashCode();
|
||||
S s = this.b;
|
||||
return hashCode ^ (s != null ? s.hashCode() : 0);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Pair{" + String.valueOf(this.a) + " " + String.valueOf(this.b) + "}";
|
||||
}
|
||||
}
|
8
sources/androidx/core/util/Pools$Pool.java
Normal file
8
sources/androidx/core/util/Pools$Pool.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package androidx.core.util;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface Pools$Pool<T> {
|
||||
T a();
|
||||
|
||||
boolean a(T t);
|
||||
}
|
52
sources/androidx/core/util/Pools$SimplePool.java
Normal file
52
sources/androidx/core/util/Pools$SimplePool.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package androidx.core.util;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Pools$SimplePool<T> implements Pools$Pool<T> {
|
||||
private final Object[] a;
|
||||
private int b;
|
||||
|
||||
public Pools$SimplePool(int i) {
|
||||
if (i <= 0) {
|
||||
throw new IllegalArgumentException("The max pool size must be > 0");
|
||||
}
|
||||
this.a = new Object[i];
|
||||
}
|
||||
|
||||
private boolean b(T t) {
|
||||
for (int i = 0; i < this.b; i++) {
|
||||
if (this.a[i] == t) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.core.util.Pools$Pool
|
||||
public T a() {
|
||||
int i = this.b;
|
||||
if (i <= 0) {
|
||||
return null;
|
||||
}
|
||||
int i2 = i - 1;
|
||||
Object[] objArr = this.a;
|
||||
T t = (T) objArr[i2];
|
||||
objArr[i2] = null;
|
||||
this.b = i - 1;
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override // androidx.core.util.Pools$Pool
|
||||
public boolean a(T t) {
|
||||
if (!b(t)) {
|
||||
int i = this.b;
|
||||
Object[] objArr = this.a;
|
||||
if (i >= objArr.length) {
|
||||
return false;
|
||||
}
|
||||
objArr[i] = t;
|
||||
this.b = i + 1;
|
||||
return true;
|
||||
}
|
||||
throw new IllegalStateException("Already in the pool!");
|
||||
}
|
||||
}
|
29
sources/androidx/core/util/Pools$SynchronizedPool.java
Normal file
29
sources/androidx/core/util/Pools$SynchronizedPool.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package androidx.core.util;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Pools$SynchronizedPool<T> extends Pools$SimplePool<T> {
|
||||
private final Object c;
|
||||
|
||||
public Pools$SynchronizedPool(int i) {
|
||||
super(i);
|
||||
this.c = new Object();
|
||||
}
|
||||
|
||||
@Override // androidx.core.util.Pools$SimplePool, androidx.core.util.Pools$Pool
|
||||
public T a() {
|
||||
T t;
|
||||
synchronized (this.c) {
|
||||
t = (T) super.a();
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override // androidx.core.util.Pools$SimplePool, androidx.core.util.Pools$Pool
|
||||
public boolean a(T t) {
|
||||
boolean a;
|
||||
synchronized (this.c) {
|
||||
a = super.a(t);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
25
sources/androidx/core/util/Preconditions.java
Normal file
25
sources/androidx/core/util/Preconditions.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package androidx.core.util;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Preconditions {
|
||||
public static <T> T a(T t) {
|
||||
if (t != null) {
|
||||
return t;
|
||||
}
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
public static <T> T a(T t, Object obj) {
|
||||
if (t != null) {
|
||||
return t;
|
||||
}
|
||||
throw new NullPointerException(String.valueOf(obj));
|
||||
}
|
||||
|
||||
public static int a(int i) {
|
||||
if (i >= 0) {
|
||||
return i;
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user