107 lines
4.6 KiB
Java
107 lines
4.6 KiB
Java
|
package com.discord.utilities.collections;
|
||
|
|
||
|
import d0.z.d.g0.a;
|
||
|
import d0.z.d.g0.e;
|
||
|
import d0.z.d.m;
|
||
|
import d0.z.d.o;
|
||
|
import java.util.Collection;
|
||
|
import java.util.List;
|
||
|
import kotlin.jvm.functions.Function1;
|
||
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||
|
/* compiled from: ShallowPartitionImmutableCollection.kt */
|
||
|
public class ShallowPartitionImmutableCollection<E, T extends Collection<E>> extends ShallowPartitionCollection<E, T> implements Collection<E>, a {
|
||
|
private final Function1<E, Integer> readOnlyPartitionStrategy;
|
||
|
|
||
|
/* compiled from: ShallowPartitionImmutableCollection.kt */
|
||
|
/* renamed from: com.discord.utilities.collections.ShallowPartitionImmutableCollection$1 reason: invalid class name */
|
||
|
public static final class AnonymousClass1 extends o implements Function1<E, Integer> {
|
||
|
public static final AnonymousClass1 INSTANCE = new AnonymousClass1();
|
||
|
|
||
|
public AnonymousClass1() {
|
||
|
super(1);
|
||
|
}
|
||
|
|
||
|
/* Return type fixed from 'int' to match base method */
|
||
|
@Override // kotlin.jvm.functions.Function1
|
||
|
public final Integer invoke(E e) {
|
||
|
return -1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* compiled from: ShallowPartitionImmutableCollection.kt */
|
||
|
public static final class Set<E, T extends java.util.Set<E>> extends ShallowPartitionImmutableCollection<E, T> implements java.util.Set<E>, e {
|
||
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
||
|
public Set(List<? extends T> list, Function1<? super E, Integer> function1) {
|
||
|
super(list, function1);
|
||
|
m.checkNotNullParameter(list, "partitions");
|
||
|
m.checkNotNullParameter(function1, "partitionStrategy");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX DEBUG: Multi-variable search result rejected for r3v0, resolved type: kotlin.jvm.functions.Function1<? super E, java.lang.Integer> */
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
||
|
public ShallowPartitionImmutableCollection(List<? extends T> list, Function1<? super E, Integer> function1) {
|
||
|
super(list, AnonymousClass1.INSTANCE);
|
||
|
m.checkNotNullParameter(list, "partitions");
|
||
|
this.readOnlyPartitionStrategy = function1;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
||
|
public /* synthetic */ ShallowPartitionImmutableCollection(List list, Function1 function1, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||
|
this(list, (i & 2) != 0 ? null : function1);
|
||
|
}
|
||
|
|
||
|
@Override // com.discord.utilities.collections.ShallowPartitionCollection, java.util.Collection
|
||
|
public boolean add(E e) {
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
|
||
|
@Override // com.discord.utilities.collections.ShallowPartitionCollection, java.util.Collection
|
||
|
public boolean addAll(Collection<? extends E> collection) {
|
||
|
m.checkNotNullParameter(collection, "elements");
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
|
||
|
@Override // com.discord.utilities.collections.ShallowPartitionCollection, java.util.Collection
|
||
|
public Void clear() {
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
|
||
|
@Override // com.discord.utilities.collections.ShallowPartitionCollection, java.util.Collection
|
||
|
public boolean contains(Object obj) {
|
||
|
Integer invoke;
|
||
|
Function1<E, Integer> function1 = this.readOnlyPartitionStrategy;
|
||
|
if (!(function1 == null || (invoke = function1.invoke(obj)) == null)) {
|
||
|
return getPartitions().get(invoke.intValue()).contains(obj);
|
||
|
}
|
||
|
List<T> partitions = getPartitions();
|
||
|
if ((partitions instanceof Collection) && partitions.isEmpty()) {
|
||
|
return false;
|
||
|
}
|
||
|
for (T t : partitions) {
|
||
|
if (t.contains(obj)) {
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
@Override // com.discord.utilities.collections.ShallowPartitionCollection, java.util.Collection
|
||
|
public boolean remove(Object obj) {
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
|
||
|
@Override // com.discord.utilities.collections.ShallowPartitionCollection, java.util.Collection
|
||
|
public boolean removeAll(Collection<? extends Object> collection) {
|
||
|
m.checkNotNullParameter(collection, "elements");
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
|
||
|
@Override // com.discord.utilities.collections.ShallowPartitionCollection, java.util.Collection
|
||
|
public boolean retainAll(Collection<? extends Object> collection) {
|
||
|
m.checkNotNullParameter(collection, "elements");
|
||
|
throw new UnsupportedOperationException();
|
||
|
}
|
||
|
}
|