jimu-decompiled/sources/com/google/common/collect/RegularImmutableList.java
2025-05-13 19:24:51 +02:00

43 lines
1.2 KiB
Java

package com.google.common.collect;
import com.google.common.base.Preconditions;
/* loaded from: classes.dex */
class RegularImmutableList<E> extends ImmutableList<E> {
static final ImmutableList<Object> c = new RegularImmutableList(new Object[0], 0);
final transient Object[] a;
private final transient int b;
RegularImmutableList(Object[] objArr, int i) {
this.a = objArr;
this.b = i;
}
@Override // com.google.common.collect.ImmutableList, com.google.common.collect.ImmutableCollection
int copyIntoArray(Object[] objArr, int i) {
System.arraycopy(this.a, 0, objArr, i, this.b);
return i + this.b;
}
@Override // java.util.List
public E get(int i) {
Preconditions.a(i, this.b);
return (E) this.a[i];
}
@Override // com.google.common.collect.ImmutableCollection
boolean isPartialView() {
return false;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public int size() {
return this.b;
}
@Override // com.google.common.collect.ImmutableList, java.util.List
public UnmodifiableListIterator<E> listIterator(int i) {
return Iterators.a(this.a, 0, this.b, i);
}
}