35 lines
1.2 KiB
Java
35 lines
1.2 KiB
Java
package com.google.android.gms.common.data;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
import org.simpleframework.xml.core.FieldScanner;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class FreezableUtils {
|
|
public static <T, E extends Freezable<T>> ArrayList<T> freeze(ArrayList<E> arrayList) {
|
|
FieldScanner fieldScanner = (ArrayList<T>) new ArrayList(arrayList.size());
|
|
int size = arrayList.size();
|
|
for (int i = 0; i < size; i++) {
|
|
fieldScanner.add(arrayList.get(i).freeze());
|
|
}
|
|
return fieldScanner;
|
|
}
|
|
|
|
public static <T, E extends Freezable<T>> ArrayList<T> freezeIterable(Iterable<E> iterable) {
|
|
FieldScanner fieldScanner = (ArrayList<T>) new ArrayList();
|
|
Iterator<E> it = iterable.iterator();
|
|
while (it.hasNext()) {
|
|
fieldScanner.add(it.next().freeze());
|
|
}
|
|
return fieldScanner;
|
|
}
|
|
|
|
public static <T, E extends Freezable<T>> ArrayList<T> freeze(E[] eArr) {
|
|
FieldScanner fieldScanner = (ArrayList<T>) new ArrayList(eArr.length);
|
|
for (E e : eArr) {
|
|
fieldScanner.add(e.freeze());
|
|
}
|
|
return fieldScanner;
|
|
}
|
|
}
|