ADD week 5
This commit is contained in:
@ -0,0 +1,27 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: SequencesJVM.kt */
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010(\n\u0000\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u0002B\u0013\u0012\f\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002¢\u0006\u0002\u0010\u0004J\u000f\u0010\b\u001a\b\u0012\u0004\u0012\u00028\u00000\tH\u0096\u0002R(\u0010\u0005\u001a\u001c\u0012\u0018\u0012\u0016\u0012\u0004\u0012\u00028\u0000 \u0007*\n\u0012\u0004\u0012\u00028\u0000\u0018\u00010\u00020\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\n"}, d2 = {"Lkotlin/sequences/ConstrainedOnceSequence;", "T", "Lkotlin/sequences/Sequence;", "sequence", "(Lkotlin/sequences/Sequence;)V", "sequenceRef", "Ljava/util/concurrent/atomic/AtomicReference;", "kotlin.jvm.PlatformType", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ConstrainedOnceSequence<T> implements Sequence<T> {
|
||||
private final AtomicReference<Sequence<T>> sequenceRef;
|
||||
|
||||
public ConstrainedOnceSequence(Sequence<? extends T> sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "sequence");
|
||||
this.sequenceRef = new AtomicReference<>(sequence);
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<T> iterator() {
|
||||
Sequence<T> andSet = this.sequenceRef.getAndSet(null);
|
||||
if (andSet == null) {
|
||||
throw new IllegalStateException("This sequence can be consumed only once.");
|
||||
}
|
||||
return andSet.iterator();
|
||||
}
|
||||
}
|
38
02-Easy5/E5/sources/kotlin/sequences/DistinctIterator.java
Normal file
38
02-Easy5/E5/sources/kotlin/sequences/DistinctIterator.java
Normal file
@ -0,0 +1,38 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.AbstractIterator;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010(\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\b\u0002\u0018\u0000*\u0004\b\u0000\u0010\u0001*\u0004\b\u0001\u0010\u00022\b\u0012\u0004\u0012\u0002H\u00010\u0003B'\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005\u0012\u0012\u0010\u0006\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010\u0007¢\u0006\u0002\u0010\bJ\b\u0010\f\u001a\u00020\rH\u0014R\u001a\u0010\u0006\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u001e\u0010\t\u001a\u0012\u0012\u0004\u0012\u00028\u00010\nj\b\u0012\u0004\u0012\u00028\u0001`\u000bX\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Lkotlin/sequences/DistinctIterator;", "T", "K", "Lkotlin/collections/AbstractIterator;", "source", "", "keySelector", "Lkotlin/Function1;", "(Ljava/util/Iterator;Lkotlin/jvm/functions/Function1;)V", "observed", "Ljava/util/HashSet;", "Lkotlin/collections/HashSet;", "computeNext", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class DistinctIterator<T, K> extends AbstractIterator<T> {
|
||||
private final Function1<T, K> keySelector;
|
||||
private final HashSet<K> observed;
|
||||
private final Iterator<T> source;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public DistinctIterator(Iterator<? extends T> source, Function1<? super T, ? extends K> keySelector) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(keySelector, "keySelector");
|
||||
this.source = source;
|
||||
this.keySelector = keySelector;
|
||||
this.observed = new HashSet<>();
|
||||
}
|
||||
|
||||
@Override // kotlin.collections.AbstractIterator
|
||||
protected void computeNext() {
|
||||
while (this.source.hasNext()) {
|
||||
T next = this.source.next();
|
||||
if (this.observed.add(this.keySelector.invoke(next))) {
|
||||
setNext(next);
|
||||
return;
|
||||
}
|
||||
}
|
||||
done();
|
||||
}
|
||||
}
|
27
02-Easy5/E5/sources/kotlin/sequences/DistinctSequence.java
Normal file
27
02-Easy5/E5/sources/kotlin/sequences/DistinctSequence.java
Normal file
@ -0,0 +1,27 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010(\n\u0000\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u0001*\u0004\b\u0001\u0010\u00022\b\u0012\u0004\u0012\u0002H\u00010\u0003B'\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0003\u0012\u0012\u0010\u0005\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010\u0006¢\u0006\u0002\u0010\u0007J\u000f\u0010\b\u001a\b\u0012\u0004\u0012\u00028\u00000\tH\u0096\u0002R\u001a\u0010\u0005\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\n"}, d2 = {"Lkotlin/sequences/DistinctSequence;", "T", "K", "Lkotlin/sequences/Sequence;", "source", "keySelector", "Lkotlin/Function1;", "(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)V", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class DistinctSequence<T, K> implements Sequence<T> {
|
||||
private final Function1<T, K> keySelector;
|
||||
private final Sequence<T> source;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public DistinctSequence(Sequence<? extends T> source, Function1<? super T, ? extends K> keySelector) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(keySelector, "keySelector");
|
||||
this.source = source;
|
||||
this.keySelector = keySelector;
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<T> iterator() {
|
||||
return new DistinctIterator(this.source.iterator(), this.keySelector);
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000#\n\u0000\n\u0002\u0010(\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001J\b\u0010\u000b\u001a\u00020\fH\u0002J\t\u0010\r\u001a\u00020\u000eH\u0096\u0002J\u000e\u0010\u000f\u001a\u00028\u0000H\u0096\u0002¢\u0006\u0002\u0010\u0010R\u0017\u0010\u0002\u001a\b\u0012\u0004\u0012\u00028\u00000\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0003\u0010\u0004R\u001a\u0010\u0005\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\n¨\u0006\u0011"}, d2 = {"kotlin/sequences/DropSequence$iterator$1", "", "iterator", "getIterator", "()Ljava/util/Iterator;", "left", "", "getLeft", "()I", "setLeft", "(I)V", "drop", "", "hasNext", "", "next", "()Ljava/lang/Object;", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class DropSequence$iterator$1<T> implements Iterator<T>, KMappedMarker {
|
||||
private final Iterator<T> iterator;
|
||||
private int left;
|
||||
|
||||
public final Iterator<T> getIterator() {
|
||||
return this.iterator;
|
||||
}
|
||||
|
||||
public final int getLeft() {
|
||||
return this.left;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
public final void setLeft(int i) {
|
||||
this.left = i;
|
||||
}
|
||||
|
||||
DropSequence$iterator$1(DropSequence<T> dropSequence) {
|
||||
Sequence sequence;
|
||||
int i;
|
||||
sequence = ((DropSequence) dropSequence).sequence;
|
||||
this.iterator = sequence.iterator();
|
||||
i = ((DropSequence) dropSequence).count;
|
||||
this.left = i;
|
||||
}
|
||||
|
||||
private final void drop() {
|
||||
while (this.left > 0 && this.iterator.hasNext()) {
|
||||
this.iterator.next();
|
||||
this.left--;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public T next() {
|
||||
drop();
|
||||
return this.iterator.next();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
drop();
|
||||
return this.iterator.hasNext();
|
||||
}
|
||||
}
|
42
02-Easy5/E5/sources/kotlin/sequences/DropSequence.java
Normal file
42
02-Easy5/E5/sources/kotlin/sequences/DropSequence.java
Normal file
@ -0,0 +1,42 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010(\n\u0002\b\u0002\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u00022\b\u0012\u0004\u0012\u0002H\u00010\u0003B\u001b\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0002\u0010\u0007J\u0016\u0010\b\u001a\b\u0012\u0004\u0012\u00028\u00000\u00022\u0006\u0010\t\u001a\u00020\u0006H\u0016J\u000f\u0010\n\u001a\b\u0012\u0004\u0012\u00028\u00000\u000bH\u0096\u0002J\u0016\u0010\f\u001a\b\u0012\u0004\u0012\u00028\u00000\u00022\u0006\u0010\t\u001a\u00020\u0006H\u0016R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\r"}, d2 = {"Lkotlin/sequences/DropSequence;", "T", "Lkotlin/sequences/Sequence;", "Lkotlin/sequences/DropTakeSequence;", "sequence", "count", "", "(Lkotlin/sequences/Sequence;I)V", "drop", "n", "iterator", "", "take", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class DropSequence<T> implements Sequence<T>, DropTakeSequence<T> {
|
||||
private final int count;
|
||||
private final Sequence<T> sequence;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public DropSequence(Sequence<? extends T> sequence, int i) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "sequence");
|
||||
this.sequence = sequence;
|
||||
this.count = i;
|
||||
if (i >= 0) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException(("count must be non-negative, but was " + i + '.').toString());
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.DropTakeSequence
|
||||
public Sequence<T> drop(int n) {
|
||||
int i = this.count + n;
|
||||
return i < 0 ? new DropSequence(this, n) : new DropSequence(this.sequence, i);
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.DropTakeSequence
|
||||
public Sequence<T> take(int n) {
|
||||
int i = this.count;
|
||||
int i2 = i + n;
|
||||
return i2 < 0 ? new TakeSequence(this, n) : new SubSequence(this.sequence, i, i2);
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<T> iterator() {
|
||||
return new DropSequence$iterator$1(this);
|
||||
}
|
||||
}
|
12
02-Easy5/E5/sources/kotlin/sequences/DropTakeSequence.java
Normal file
12
02-Easy5/E5/sources/kotlin/sequences/DropTakeSequence.java
Normal file
@ -0,0 +1,12 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\b`\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u0002J\u0016\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u00022\u0006\u0010\u0004\u001a\u00020\u0005H&J\u0016\u0010\u0006\u001a\b\u0012\u0004\u0012\u00028\u00000\u00022\u0006\u0010\u0004\u001a\u00020\u0005H&¨\u0006\u0007"}, d2 = {"Lkotlin/sequences/DropTakeSequence;", "T", "Lkotlin/sequences/Sequence;", "drop", "n", "", "take", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public interface DropTakeSequence<T> extends Sequence<T> {
|
||||
Sequence<T> drop(int n);
|
||||
|
||||
Sequence<T> take(int n);
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000!\n\u0000\n\u0002\u0010(\n\u0000\n\u0002\u0010\b\n\u0002\b\u000e\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001J\b\u0010\u0011\u001a\u00020\u0012H\u0002J\t\u0010\u0013\u001a\u00020\u0014H\u0096\u0002J\u000e\u0010\u0015\u001a\u00028\u0000H\u0096\u0002¢\u0006\u0002\u0010\rR\u001a\u0010\u0002\u001a\u00020\u0003X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0004\u0010\u0005\"\u0004\b\u0006\u0010\u0007R\u0017\u0010\b\u001a\b\u0012\u0004\u0012\u00028\u00000\u0001¢\u0006\b\n\u0000\u001a\u0004\b\t\u0010\nR\u001e\u0010\u000b\u001a\u0004\u0018\u00018\u0000X\u0086\u000e¢\u0006\u0010\n\u0002\u0010\u0010\u001a\u0004\b\f\u0010\r\"\u0004\b\u000e\u0010\u000f¨\u0006\u0016"}, d2 = {"kotlin/sequences/DropWhileSequence$iterator$1", "", "dropState", "", "getDropState", "()I", "setDropState", "(I)V", "iterator", "getIterator", "()Ljava/util/Iterator;", "nextItem", "getNextItem", "()Ljava/lang/Object;", "setNextItem", "(Ljava/lang/Object;)V", "Ljava/lang/Object;", "drop", "", "hasNext", "", "next", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class DropWhileSequence$iterator$1<T> implements Iterator<T>, KMappedMarker {
|
||||
private int dropState;
|
||||
private final Iterator<T> iterator;
|
||||
private T nextItem;
|
||||
final /* synthetic */ DropWhileSequence<T> this$0;
|
||||
|
||||
public final int getDropState() {
|
||||
return this.dropState;
|
||||
}
|
||||
|
||||
public final Iterator<T> getIterator() {
|
||||
return this.iterator;
|
||||
}
|
||||
|
||||
public final T getNextItem() {
|
||||
return this.nextItem;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
public final void setDropState(int i) {
|
||||
this.dropState = i;
|
||||
}
|
||||
|
||||
public final void setNextItem(T t) {
|
||||
this.nextItem = t;
|
||||
}
|
||||
|
||||
DropWhileSequence$iterator$1(DropWhileSequence<T> dropWhileSequence) {
|
||||
Sequence sequence;
|
||||
this.this$0 = dropWhileSequence;
|
||||
sequence = ((DropWhileSequence) dropWhileSequence).sequence;
|
||||
this.iterator = sequence.iterator();
|
||||
this.dropState = -1;
|
||||
}
|
||||
|
||||
private final void drop() {
|
||||
Function1 function1;
|
||||
while (this.iterator.hasNext()) {
|
||||
T next = this.iterator.next();
|
||||
function1 = ((DropWhileSequence) this.this$0).predicate;
|
||||
if (!((Boolean) function1.invoke(next)).booleanValue()) {
|
||||
this.nextItem = next;
|
||||
this.dropState = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.dropState = 0;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public T next() {
|
||||
if (this.dropState == -1) {
|
||||
drop();
|
||||
}
|
||||
if (this.dropState != 1) {
|
||||
return this.iterator.next();
|
||||
}
|
||||
T t = this.nextItem;
|
||||
this.nextItem = null;
|
||||
this.dropState = 0;
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
if (this.dropState == -1) {
|
||||
drop();
|
||||
}
|
||||
return this.dropState == 1 || this.iterator.hasNext();
|
||||
}
|
||||
}
|
27
02-Easy5/E5/sources/kotlin/sequences/DropWhileSequence.java
Normal file
27
02-Easy5/E5/sources/kotlin/sequences/DropWhileSequence.java
Normal file
@ -0,0 +1,27 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010(\n\u0000\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u0002B'\u0012\f\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002\u0012\u0012\u0010\u0004\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00020\u00060\u0005¢\u0006\u0002\u0010\u0007J\u000f\u0010\b\u001a\b\u0012\u0004\u0012\u00028\u00000\tH\u0096\u0002R\u001a\u0010\u0004\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00020\u00060\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\n"}, d2 = {"Lkotlin/sequences/DropWhileSequence;", "T", "Lkotlin/sequences/Sequence;", "sequence", "predicate", "Lkotlin/Function1;", "", "(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)V", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class DropWhileSequence<T> implements Sequence<T> {
|
||||
private final Function1<T, Boolean> predicate;
|
||||
private final Sequence<T> sequence;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public DropWhileSequence(Sequence<? extends T> sequence, Function1<? super T, Boolean> predicate) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "sequence");
|
||||
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
||||
this.sequence = sequence;
|
||||
this.predicate = predicate;
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<T> iterator() {
|
||||
return new DropWhileSequence$iterator$1(this);
|
||||
}
|
||||
}
|
30
02-Easy5/E5/sources/kotlin/sequences/EmptySequence.java
Normal file
30
02-Easy5/E5/sources/kotlin/sequences/EmptySequence.java
Normal file
@ -0,0 +1,30 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.EmptyIterator;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0001\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0000\n\u0002\u0010(\n\u0002\b\u0002\bÂ\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u00012\b\u0012\u0004\u0012\u00020\u00020\u0003B\u0007\b\u0002¢\u0006\u0002\u0010\u0004J\u0010\u0010\u0005\u001a\u00020\u00002\u0006\u0010\u0006\u001a\u00020\u0007H\u0016J\u000f\u0010\b\u001a\b\u0012\u0004\u0012\u00020\u00020\tH\u0096\u0002J\u0010\u0010\n\u001a\u00020\u00002\u0006\u0010\u0006\u001a\u00020\u0007H\u0016¨\u0006\u000b"}, d2 = {"Lkotlin/sequences/EmptySequence;", "Lkotlin/sequences/Sequence;", "", "Lkotlin/sequences/DropTakeSequence;", "()V", "drop", "n", "", "iterator", "", "take", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class EmptySequence implements Sequence, DropTakeSequence {
|
||||
public static final EmptySequence INSTANCE = new EmptySequence();
|
||||
|
||||
@Override // kotlin.sequences.DropTakeSequence
|
||||
public EmptySequence drop(int n) {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.DropTakeSequence
|
||||
public EmptySequence take(int n) {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private EmptySequence() {
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator iterator() {
|
||||
return EmptyIterator.INSTANCE;
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000#\n\u0000\n\u0002\u0010(\n\u0002\b\n\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001J\b\u0010\u0011\u001a\u00020\u0012H\u0002J\t\u0010\u0013\u001a\u00020\u0014H\u0096\u0002J\u000e\u0010\u0015\u001a\u00028\u0000H\u0096\u0002¢\u0006\u0002\u0010\u0007R\u0017\u0010\u0002\u001a\b\u0012\u0004\u0012\u00028\u00000\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0003\u0010\u0004R\u001e\u0010\u0005\u001a\u0004\u0018\u00018\u0000X\u0086\u000e¢\u0006\u0010\n\u0002\u0010\n\u001a\u0004\b\u0006\u0010\u0007\"\u0004\b\b\u0010\tR\u001a\u0010\u000b\u001a\u00020\fX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\r\u0010\u000e\"\u0004\b\u000f\u0010\u0010¨\u0006\u0016"}, d2 = {"kotlin/sequences/FilteringSequence$iterator$1", "", "iterator", "getIterator", "()Ljava/util/Iterator;", "nextItem", "getNextItem", "()Ljava/lang/Object;", "setNextItem", "(Ljava/lang/Object;)V", "Ljava/lang/Object;", "nextState", "", "getNextState", "()I", "setNextState", "(I)V", "calcNext", "", "hasNext", "", "next", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class FilteringSequence$iterator$1<T> implements Iterator<T>, KMappedMarker {
|
||||
private final Iterator<T> iterator;
|
||||
private T nextItem;
|
||||
private int nextState;
|
||||
final /* synthetic */ FilteringSequence<T> this$0;
|
||||
|
||||
public final Iterator<T> getIterator() {
|
||||
return this.iterator;
|
||||
}
|
||||
|
||||
public final T getNextItem() {
|
||||
return this.nextItem;
|
||||
}
|
||||
|
||||
public final int getNextState() {
|
||||
return this.nextState;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
public final void setNextItem(T t) {
|
||||
this.nextItem = t;
|
||||
}
|
||||
|
||||
public final void setNextState(int i) {
|
||||
this.nextState = i;
|
||||
}
|
||||
|
||||
FilteringSequence$iterator$1(FilteringSequence<T> filteringSequence) {
|
||||
Sequence sequence;
|
||||
this.this$0 = filteringSequence;
|
||||
sequence = ((FilteringSequence) filteringSequence).sequence;
|
||||
this.iterator = sequence.iterator();
|
||||
this.nextState = -1;
|
||||
}
|
||||
|
||||
private final void calcNext() {
|
||||
Function1 function1;
|
||||
boolean z;
|
||||
while (this.iterator.hasNext()) {
|
||||
T next = this.iterator.next();
|
||||
function1 = ((FilteringSequence) this.this$0).predicate;
|
||||
boolean booleanValue = ((Boolean) function1.invoke(next)).booleanValue();
|
||||
z = ((FilteringSequence) this.this$0).sendWhen;
|
||||
if (booleanValue == z) {
|
||||
this.nextItem = next;
|
||||
this.nextState = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.nextState = 0;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public T next() {
|
||||
if (this.nextState == -1) {
|
||||
calcNext();
|
||||
}
|
||||
if (this.nextState == 0) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
T t = this.nextItem;
|
||||
this.nextItem = null;
|
||||
this.nextState = -1;
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
if (this.nextState == -1) {
|
||||
calcNext();
|
||||
}
|
||||
return this.nextState == 1;
|
||||
}
|
||||
}
|
34
02-Easy5/E5/sources/kotlin/sequences/FilteringSequence.java
Normal file
34
02-Easy5/E5/sources/kotlin/sequences/FilteringSequence.java
Normal file
@ -0,0 +1,34 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010(\n\u0000\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u0002B1\u0012\f\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002\u0012\b\b\u0002\u0010\u0004\u001a\u00020\u0005\u0012\u0012\u0010\u0006\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00020\u00050\u0007¢\u0006\u0002\u0010\bJ\u000f\u0010\t\u001a\b\u0012\u0004\u0012\u00028\u00000\nH\u0096\u0002R\u001a\u0010\u0006\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00020\u00050\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000b"}, d2 = {"Lkotlin/sequences/FilteringSequence;", "T", "Lkotlin/sequences/Sequence;", "sequence", "sendWhen", "", "predicate", "Lkotlin/Function1;", "(Lkotlin/sequences/Sequence;ZLkotlin/jvm/functions/Function1;)V", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class FilteringSequence<T> implements Sequence<T> {
|
||||
private final Function1<T, Boolean> predicate;
|
||||
private final boolean sendWhen;
|
||||
private final Sequence<T> sequence;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public FilteringSequence(Sequence<? extends T> sequence, boolean z, Function1<? super T, Boolean> predicate) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "sequence");
|
||||
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
||||
this.sequence = sequence;
|
||||
this.sendWhen = z;
|
||||
this.predicate = predicate;
|
||||
}
|
||||
|
||||
public /* synthetic */ FilteringSequence(Sequence sequence, boolean z, Function1 function1, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this(sequence, (i & 2) != 0 ? true : z, function1);
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<T> iterator() {
|
||||
return new FilteringSequence$iterator$1(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [E] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u0015\n\u0000\n\u0002\u0010(\n\u0002\b\b\n\u0002\u0010\u000b\n\u0002\b\u0004*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001J\b\u0010\t\u001a\u00020\nH\u0002J\t\u0010\u000b\u001a\u00020\nH\u0096\u0002J\u000e\u0010\f\u001a\u00028\u0000H\u0096\u0002¢\u0006\u0002\u0010\rR\"\u0010\u0002\u001a\n\u0012\u0004\u0012\u00028\u0000\u0018\u00010\u0001X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0003\u0010\u0004\"\u0004\b\u0005\u0010\u0006R\u0017\u0010\u0007\u001a\b\u0012\u0004\u0012\u00028\u00010\u0001¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\u0004¨\u0006\u000e"}, d2 = {"kotlin/sequences/FlatteningSequence$iterator$1", "", "itemIterator", "getItemIterator", "()Ljava/util/Iterator;", "setItemIterator", "(Ljava/util/Iterator;)V", "iterator", "getIterator", "ensureItemIterator", "", "hasNext", "next", "()Ljava/lang/Object;", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class FlatteningSequence$iterator$1<E> implements Iterator<E>, KMappedMarker {
|
||||
private Iterator<? extends E> itemIterator;
|
||||
private final Iterator<T> iterator;
|
||||
final /* synthetic */ FlatteningSequence<T, R, E> this$0;
|
||||
|
||||
public final Iterator<E> getItemIterator() {
|
||||
return this.itemIterator;
|
||||
}
|
||||
|
||||
public final Iterator<T> getIterator() {
|
||||
return this.iterator;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
public final void setItemIterator(Iterator<? extends E> it) {
|
||||
this.itemIterator = it;
|
||||
}
|
||||
|
||||
FlatteningSequence$iterator$1(FlatteningSequence<T, R, E> flatteningSequence) {
|
||||
Sequence sequence;
|
||||
this.this$0 = flatteningSequence;
|
||||
sequence = ((FlatteningSequence) flatteningSequence).sequence;
|
||||
this.iterator = sequence.iterator();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public E next() {
|
||||
if (!ensureItemIterator()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
Iterator<? extends E> it = this.itemIterator;
|
||||
Intrinsics.checkNotNull(it);
|
||||
return it.next();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
return ensureItemIterator();
|
||||
}
|
||||
|
||||
private final boolean ensureItemIterator() {
|
||||
Function1 function1;
|
||||
Function1 function12;
|
||||
Iterator<? extends E> it = this.itemIterator;
|
||||
if (it != null && !it.hasNext()) {
|
||||
this.itemIterator = null;
|
||||
}
|
||||
while (true) {
|
||||
if (this.itemIterator != null) {
|
||||
break;
|
||||
}
|
||||
if (!this.iterator.hasNext()) {
|
||||
return false;
|
||||
}
|
||||
Object next = this.iterator.next();
|
||||
function1 = ((FlatteningSequence) this.this$0).iterator;
|
||||
function12 = ((FlatteningSequence) this.this$0).transformer;
|
||||
Iterator<? extends E> it2 = (Iterator) function1.invoke(function12.invoke(next));
|
||||
if (it2.hasNext()) {
|
||||
this.itemIterator = it2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
30
02-Easy5/E5/sources/kotlin/sequences/FlatteningSequence.java
Normal file
30
02-Easy5/E5/sources/kotlin/sequences/FlatteningSequence.java
Normal file
@ -0,0 +1,30 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010(\n\u0002\b\u0002\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u0001*\u0004\b\u0001\u0010\u0002*\u0004\b\u0002\u0010\u00032\b\u0012\u0004\u0012\u0002H\u00030\u0004BA\u0012\f\u0010\u0005\u001a\b\u0012\u0004\u0012\u00028\u00000\u0004\u0012\u0012\u0010\u0006\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010\u0007\u0012\u0018\u0010\b\u001a\u0014\u0012\u0004\u0012\u00028\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00020\t0\u0007¢\u0006\u0002\u0010\nJ\u000f\u0010\b\u001a\b\u0012\u0004\u0012\u00028\u00020\tH\u0096\u0002R \u0010\b\u001a\u0014\u0012\u0004\u0012\u00028\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00020\t0\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0005\u001a\b\u0012\u0004\u0012\u00028\u00000\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u001a\u0010\u0006\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010\u0007X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000b"}, d2 = {"Lkotlin/sequences/FlatteningSequence;", "T", "R", "E", "Lkotlin/sequences/Sequence;", "sequence", "transformer", "Lkotlin/Function1;", "iterator", "", "(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class FlatteningSequence<T, R, E> implements Sequence<E> {
|
||||
private final Function1<R, Iterator<E>> iterator;
|
||||
private final Sequence<T> sequence;
|
||||
private final Function1<T, R> transformer;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public FlatteningSequence(Sequence<? extends T> sequence, Function1<? super T, ? extends R> transformer, Function1<? super R, ? extends Iterator<? extends E>> iterator) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "sequence");
|
||||
Intrinsics.checkNotNullParameter(transformer, "transformer");
|
||||
Intrinsics.checkNotNullParameter(iterator, "iterator");
|
||||
this.sequence = sequence;
|
||||
this.transformer = transformer;
|
||||
this.iterator = iterator;
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<E> iterator() {
|
||||
return new FlatteningSequence$iterator$1(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000#\n\u0000\n\u0002\u0010(\n\u0002\b\u0007\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001J\b\u0010\u000e\u001a\u00020\u000fH\u0002J\t\u0010\u0010\u001a\u00020\u0011H\u0096\u0002J\u000e\u0010\u0012\u001a\u00028\u0000H\u0096\u0002¢\u0006\u0002\u0010\u0004R\u001e\u0010\u0002\u001a\u0004\u0018\u00018\u0000X\u0086\u000e¢\u0006\u0010\n\u0002\u0010\u0007\u001a\u0004\b\u0003\u0010\u0004\"\u0004\b\u0005\u0010\u0006R\u001a\u0010\b\u001a\u00020\tX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\n\u0010\u000b\"\u0004\b\f\u0010\r¨\u0006\u0013"}, d2 = {"kotlin/sequences/GeneratorSequence$iterator$1", "", "nextItem", "getNextItem", "()Ljava/lang/Object;", "setNextItem", "(Ljava/lang/Object;)V", "Ljava/lang/Object;", "nextState", "", "getNextState", "()I", "setNextState", "(I)V", "calcNext", "", "hasNext", "", "next", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class GeneratorSequence$iterator$1<T> implements Iterator<T>, KMappedMarker {
|
||||
private T nextItem;
|
||||
private int nextState = -2;
|
||||
final /* synthetic */ GeneratorSequence<T> this$0;
|
||||
|
||||
public final T getNextItem() {
|
||||
return this.nextItem;
|
||||
}
|
||||
|
||||
public final int getNextState() {
|
||||
return this.nextState;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
public final void setNextItem(T t) {
|
||||
this.nextItem = t;
|
||||
}
|
||||
|
||||
public final void setNextState(int i) {
|
||||
this.nextState = i;
|
||||
}
|
||||
|
||||
GeneratorSequence$iterator$1(GeneratorSequence<T> generatorSequence) {
|
||||
this.this$0 = generatorSequence;
|
||||
}
|
||||
|
||||
private final void calcNext() {
|
||||
Function1 function1;
|
||||
T t;
|
||||
Function0 function0;
|
||||
if (this.nextState == -2) {
|
||||
function0 = ((GeneratorSequence) this.this$0).getInitialValue;
|
||||
t = (T) function0.invoke();
|
||||
} else {
|
||||
function1 = ((GeneratorSequence) this.this$0).getNextValue;
|
||||
T t2 = this.nextItem;
|
||||
Intrinsics.checkNotNull(t2);
|
||||
t = (T) function1.invoke(t2);
|
||||
}
|
||||
this.nextItem = t;
|
||||
this.nextState = t == null ? 0 : 1;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public T next() {
|
||||
if (this.nextState < 0) {
|
||||
calcNext();
|
||||
}
|
||||
if (this.nextState == 0) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
T t = this.nextItem;
|
||||
Intrinsics.checkNotNull(t, "null cannot be cast to non-null type T of kotlin.sequences.GeneratorSequence");
|
||||
this.nextState = -1;
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
if (this.nextState < 0) {
|
||||
calcNext();
|
||||
}
|
||||
return this.nextState == 1;
|
||||
}
|
||||
}
|
28
02-Easy5/E5/sources/kotlin/sequences/GeneratorSequence.java
Normal file
28
02-Easy5/E5/sources/kotlin/sequences/GeneratorSequence.java
Normal file
@ -0,0 +1,28 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010(\n\u0000\b\u0002\u0018\u0000*\b\b\u0000\u0010\u0001*\u00020\u00022\b\u0012\u0004\u0012\u0002H\u00010\u0003B+\u0012\u000e\u0010\u0004\u001a\n\u0012\u0006\u0012\u0004\u0018\u00018\u00000\u0005\u0012\u0014\u0010\u0006\u001a\u0010\u0012\u0004\u0012\u00028\u0000\u0012\u0006\u0012\u0004\u0018\u00018\u00000\u0007¢\u0006\u0002\u0010\bJ\u000f\u0010\t\u001a\b\u0012\u0004\u0012\u00028\u00000\nH\u0096\u0002R\u0016\u0010\u0004\u001a\n\u0012\u0006\u0012\u0004\u0018\u00018\u00000\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u001c\u0010\u0006\u001a\u0010\u0012\u0004\u0012\u00028\u0000\u0012\u0006\u0012\u0004\u0018\u00018\u00000\u0007X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000b"}, d2 = {"Lkotlin/sequences/GeneratorSequence;", "T", "", "Lkotlin/sequences/Sequence;", "getInitialValue", "Lkotlin/Function0;", "getNextValue", "Lkotlin/Function1;", "(Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)V", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class GeneratorSequence<T> implements Sequence<T> {
|
||||
private final Function0<T> getInitialValue;
|
||||
private final Function1<T, T> getNextValue;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public GeneratorSequence(Function0<? extends T> getInitialValue, Function1<? super T, ? extends T> getNextValue) {
|
||||
Intrinsics.checkNotNullParameter(getInitialValue, "getInitialValue");
|
||||
Intrinsics.checkNotNullParameter(getNextValue, "getNextValue");
|
||||
this.getInitialValue = getInitialValue;
|
||||
this.getNextValue = getNextValue;
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<T> iterator() {
|
||||
return new GeneratorSequence$iterator$1(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.collections.IndexedValue;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u001f\n\u0000\n\u0002\u0010(\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\b\n\u0002\u0010\u000b\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00020\u0001J\t\u0010\f\u001a\u00020\rH\u0096\u0002J\u000f\u0010\u000e\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002H\u0096\u0002R\u001a\u0010\u0003\u001a\u00020\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0005\u0010\u0006\"\u0004\b\u0007\u0010\bR\u0017\u0010\t\u001a\b\u0012\u0004\u0012\u00028\u00000\u0001¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010\u000b¨\u0006\u000f"}, d2 = {"kotlin/sequences/IndexingSequence$iterator$1", "", "Lkotlin/collections/IndexedValue;", "index", "", "getIndex", "()I", "setIndex", "(I)V", "iterator", "getIterator", "()Ljava/util/Iterator;", "hasNext", "", "next", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class IndexingSequence$iterator$1<T> implements Iterator<IndexedValue<? extends T>>, KMappedMarker {
|
||||
private int index;
|
||||
private final Iterator<T> iterator;
|
||||
|
||||
public final int getIndex() {
|
||||
return this.index;
|
||||
}
|
||||
|
||||
public final Iterator<T> getIterator() {
|
||||
return this.iterator;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
public final void setIndex(int i) {
|
||||
this.index = i;
|
||||
}
|
||||
|
||||
IndexingSequence$iterator$1(IndexingSequence<T> indexingSequence) {
|
||||
Sequence sequence;
|
||||
sequence = ((IndexingSequence) indexingSequence).sequence;
|
||||
this.iterator = sequence.iterator();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public IndexedValue<T> next() {
|
||||
int i = this.index;
|
||||
this.index = i + 1;
|
||||
if (i < 0) {
|
||||
CollectionsKt.throwIndexOverflow();
|
||||
}
|
||||
return new IndexedValue<>(i, this.iterator.next());
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
return this.iterator.hasNext();
|
||||
}
|
||||
}
|
24
02-Easy5/E5/sources/kotlin/sequences/IndexingSequence.java
Normal file
24
02-Easy5/E5/sources/kotlin/sequences/IndexingSequence.java
Normal file
@ -0,0 +1,24 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.IndexedValue;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010(\n\u0000\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00010\u00030\u0002B\u0013\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002¢\u0006\u0002\u0010\u0005J\u0015\u0010\u0006\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u00030\u0007H\u0096\u0002R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\b"}, d2 = {"Lkotlin/sequences/IndexingSequence;", "T", "Lkotlin/sequences/Sequence;", "Lkotlin/collections/IndexedValue;", "sequence", "(Lkotlin/sequences/Sequence;)V", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class IndexingSequence<T> implements Sequence<IndexedValue<? extends T>> {
|
||||
private final Sequence<T> sequence;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public IndexingSequence(Sequence<? extends T> sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "sequence");
|
||||
this.sequence = sequence;
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<IndexedValue<T>> iterator() {
|
||||
return new IndexingSequence$iterator$1(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [V] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u0015\n\u0000\n\u0002\u0010(\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001J\t\u0010\u0007\u001a\u00020\bH\u0096\u0002J\u000e\u0010\t\u001a\u00028\u0000H\u0096\u0002¢\u0006\u0002\u0010\nR\u0017\u0010\u0002\u001a\b\u0012\u0004\u0012\u00028\u00010\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0003\u0010\u0004R\u0017\u0010\u0005\u001a\b\u0012\u0004\u0012\u00028\u00010\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0004¨\u0006\u000b"}, d2 = {"kotlin/sequences/MergingSequence$iterator$1", "", "iterator1", "getIterator1", "()Ljava/util/Iterator;", "iterator2", "getIterator2", "hasNext", "", "next", "()Ljava/lang/Object;", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class MergingSequence$iterator$1<V> implements Iterator<V>, KMappedMarker {
|
||||
private final Iterator<T1> iterator1;
|
||||
private final Iterator<T2> iterator2;
|
||||
final /* synthetic */ MergingSequence<T1, T2, V> this$0;
|
||||
|
||||
public final Iterator<T1> getIterator1() {
|
||||
return this.iterator1;
|
||||
}
|
||||
|
||||
public final Iterator<T2> getIterator2() {
|
||||
return this.iterator2;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
MergingSequence$iterator$1(MergingSequence<T1, T2, V> mergingSequence) {
|
||||
Sequence sequence;
|
||||
Sequence sequence2;
|
||||
this.this$0 = mergingSequence;
|
||||
sequence = ((MergingSequence) mergingSequence).sequence1;
|
||||
this.iterator1 = sequence.iterator();
|
||||
sequence2 = ((MergingSequence) mergingSequence).sequence2;
|
||||
this.iterator2 = sequence2.iterator();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public V next() {
|
||||
Function2 function2;
|
||||
function2 = ((MergingSequence) this.this$0).transform;
|
||||
return (V) function2.invoke(this.iterator1.next(), this.iterator2.next());
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
return this.iterator1.hasNext() && this.iterator2.hasNext();
|
||||
}
|
||||
}
|
30
02-Easy5/E5/sources/kotlin/sequences/MergingSequence.java
Normal file
30
02-Easy5/E5/sources/kotlin/sequences/MergingSequence.java
Normal file
@ -0,0 +1,30 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010(\n\u0000\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u0001*\u0004\b\u0001\u0010\u0002*\u0004\b\u0002\u0010\u00032\b\u0012\u0004\u0012\u0002H\u00030\u0004B;\u0012\f\u0010\u0005\u001a\b\u0012\u0004\u0012\u00028\u00000\u0004\u0012\f\u0010\u0006\u001a\b\u0012\u0004\u0012\u00028\u00010\u0004\u0012\u0018\u0010\u0007\u001a\u0014\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u0001\u0012\u0004\u0012\u00028\u00020\b¢\u0006\u0002\u0010\tJ\u000f\u0010\n\u001a\b\u0012\u0004\u0012\u00028\u00020\u000bH\u0096\u0002R\u0014\u0010\u0005\u001a\b\u0012\u0004\u0012\u00028\u00000\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0006\u001a\b\u0012\u0004\u0012\u00028\u00010\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R \u0010\u0007\u001a\u0014\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u0001\u0012\u0004\u0012\u00028\u00020\bX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\f"}, d2 = {"Lkotlin/sequences/MergingSequence;", "T1", "T2", "V", "Lkotlin/sequences/Sequence;", "sequence1", "sequence2", "transform", "Lkotlin/Function2;", "(Lkotlin/sequences/Sequence;Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function2;)V", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class MergingSequence<T1, T2, V> implements Sequence<V> {
|
||||
private final Sequence<T1> sequence1;
|
||||
private final Sequence<T2> sequence2;
|
||||
private final Function2<T1, T2, V> transform;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public MergingSequence(Sequence<? extends T1> sequence1, Sequence<? extends T2> sequence2, Function2<? super T1, ? super T2, ? extends V> transform) {
|
||||
Intrinsics.checkNotNullParameter(sequence1, "sequence1");
|
||||
Intrinsics.checkNotNullParameter(sequence2, "sequence2");
|
||||
Intrinsics.checkNotNullParameter(transform, "transform");
|
||||
this.sequence1 = sequence1;
|
||||
this.sequence2 = sequence2;
|
||||
this.transform = transform;
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<V> iterator() {
|
||||
return new MergingSequence$iterator$1(this);
|
||||
}
|
||||
}
|
11
02-Easy5/E5/sources/kotlin/sequences/Sequence.java
Normal file
11
02-Easy5/E5/sources/kotlin/sequences/Sequence.java
Normal file
@ -0,0 +1,11 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: Sequence.kt */
|
||||
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010(\n\u0000\bf\u0018\u0000*\u0006\b\u0000\u0010\u0001 \u00012\u00020\u0002J\u000f\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0004H¦\u0002¨\u0006\u0005"}, d2 = {"Lkotlin/sequences/Sequence;", "T", "", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public interface Sequence<T> {
|
||||
Iterator<T> iterator();
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Result;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.coroutines.EmptyCoroutineContext;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugProbesKt;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* compiled from: SequenceBuilder.kt */
|
||||
@Metadata(d1 = {"\u0000B\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010(\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0010\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\b\b\u0002\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u00022\b\u0012\u0004\u0012\u0002H\u00010\u00032\b\u0012\u0004\u0012\u00020\u00050\u0004B\u0005¢\u0006\u0002\u0010\u0006J\b\u0010\u0016\u001a\u00020\u0017H\u0002J\t\u0010\u0018\u001a\u00020\u0019H\u0096\u0002J\u000e\u0010\u001a\u001a\u00028\u0000H\u0096\u0002¢\u0006\u0002\u0010\u001bJ\r\u0010\u001c\u001a\u00028\u0000H\u0002¢\u0006\u0002\u0010\u001bJ\u001e\u0010\u001d\u001a\u00020\u00052\f\u0010\u001e\u001a\b\u0012\u0004\u0012\u00020\u00050\u001fH\u0016ø\u0001\u0000¢\u0006\u0002\u0010 J\u0019\u0010!\u001a\u00020\u00052\u0006\u0010\"\u001a\u00028\u0000H\u0096@ø\u0001\u0000¢\u0006\u0002\u0010#J\u001f\u0010$\u001a\u00020\u00052\f\u0010%\u001a\b\u0012\u0004\u0012\u00028\u00000\u0003H\u0096@ø\u0001\u0000¢\u0006\u0002\u0010&R\u0014\u0010\u0007\u001a\u00020\b8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\t\u0010\nR\u0016\u0010\u000b\u001a\n\u0012\u0004\u0012\u00028\u0000\u0018\u00010\u0003X\u0082\u000e¢\u0006\u0002\n\u0000R\"\u0010\f\u001a\n\u0012\u0004\u0012\u00020\u0005\u0018\u00010\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\r\u0010\u000e\"\u0004\b\u000f\u0010\u0010R\u0012\u0010\u0011\u001a\u0004\u0018\u00018\u0000X\u0082\u000e¢\u0006\u0004\n\u0002\u0010\u0012R\u0012\u0010\u0013\u001a\u00060\u0014j\u0002`\u0015X\u0082\u000e¢\u0006\u0002\n\u0000\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006'"}, d2 = {"Lkotlin/sequences/SequenceBuilderIterator;", "T", "Lkotlin/sequences/SequenceScope;", "", "Lkotlin/coroutines/Continuation;", "", "()V", "context", "Lkotlin/coroutines/CoroutineContext;", "getContext", "()Lkotlin/coroutines/CoroutineContext;", "nextIterator", "nextStep", "getNextStep", "()Lkotlin/coroutines/Continuation;", "setNextStep", "(Lkotlin/coroutines/Continuation;)V", "nextValue", "Ljava/lang/Object;", "state", "", "Lkotlin/sequences/State;", "exceptionalState", "", "hasNext", "", "next", "()Ljava/lang/Object;", "nextNotReady", "resumeWith", "result", "Lkotlin/Result;", "(Ljava/lang/Object;)V", "yield", "value", "(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "yieldAll", "iterator", "(Ljava/util/Iterator;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class SequenceBuilderIterator<T> extends SequenceScope<T> implements Iterator<T>, Continuation<Unit>, KMappedMarker {
|
||||
private Iterator<? extends T> nextIterator;
|
||||
private Continuation<? super Unit> nextStep;
|
||||
private T nextValue;
|
||||
private int state;
|
||||
|
||||
public final Continuation<Unit> getNextStep() {
|
||||
return this.nextStep;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
public final void setNextStep(Continuation<? super Unit> continuation) {
|
||||
this.nextStep = continuation;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
while (true) {
|
||||
int i = this.state;
|
||||
if (i != 0) {
|
||||
if (i != 1) {
|
||||
if (i == 2 || i == 3) {
|
||||
return true;
|
||||
}
|
||||
if (i == 4) {
|
||||
return false;
|
||||
}
|
||||
throw exceptionalState();
|
||||
}
|
||||
Iterator<? extends T> it = this.nextIterator;
|
||||
Intrinsics.checkNotNull(it);
|
||||
if (it.hasNext()) {
|
||||
this.state = 2;
|
||||
return true;
|
||||
}
|
||||
this.nextIterator = null;
|
||||
}
|
||||
this.state = 5;
|
||||
Continuation<? super Unit> continuation = this.nextStep;
|
||||
Intrinsics.checkNotNull(continuation);
|
||||
this.nextStep = null;
|
||||
Result.Companion companion = Result.INSTANCE;
|
||||
continuation.resumeWith(Result.m288constructorimpl(Unit.INSTANCE));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public T next() {
|
||||
int i = this.state;
|
||||
if (i == 0 || i == 1) {
|
||||
return nextNotReady();
|
||||
}
|
||||
if (i == 2) {
|
||||
this.state = 1;
|
||||
Iterator<? extends T> it = this.nextIterator;
|
||||
Intrinsics.checkNotNull(it);
|
||||
return it.next();
|
||||
}
|
||||
if (i != 3) {
|
||||
throw exceptionalState();
|
||||
}
|
||||
this.state = 0;
|
||||
T t = this.nextValue;
|
||||
this.nextValue = null;
|
||||
return t;
|
||||
}
|
||||
|
||||
private final T nextNotReady() {
|
||||
if (hasNext()) {
|
||||
return next();
|
||||
}
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
|
||||
private final Throwable exceptionalState() {
|
||||
int i = this.state;
|
||||
if (i == 4) {
|
||||
return new NoSuchElementException();
|
||||
}
|
||||
if (i == 5) {
|
||||
return new IllegalStateException("Iterator has failed.");
|
||||
}
|
||||
return new IllegalStateException("Unexpected state of the iterator: " + this.state);
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.SequenceScope
|
||||
public Object yield(T t, Continuation<? super Unit> continuation) {
|
||||
this.nextValue = t;
|
||||
this.state = 3;
|
||||
this.nextStep = continuation;
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
if (coroutine_suspended == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
|
||||
DebugProbesKt.probeCoroutineSuspended(continuation);
|
||||
}
|
||||
return coroutine_suspended == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? coroutine_suspended : Unit.INSTANCE;
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.SequenceScope
|
||||
public Object yieldAll(Iterator<? extends T> it, Continuation<? super Unit> continuation) {
|
||||
if (!it.hasNext()) {
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
this.nextIterator = it;
|
||||
this.state = 2;
|
||||
this.nextStep = continuation;
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
if (coroutine_suspended == IntrinsicsKt.getCOROUTINE_SUSPENDED()) {
|
||||
DebugProbesKt.probeCoroutineSuspended(continuation);
|
||||
}
|
||||
return coroutine_suspended == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? coroutine_suspended : Unit.INSTANCE;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.Continuation
|
||||
public void resumeWith(Object result) {
|
||||
ResultKt.throwOnFailure(result);
|
||||
this.state = 4;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.Continuation
|
||||
/* renamed from: getContext */
|
||||
public CoroutineContext get$context() {
|
||||
return EmptyCoroutineContext.INSTANCE;
|
||||
}
|
||||
}
|
27
02-Easy5/E5/sources/kotlin/sequences/SequenceScope.java
Normal file
27
02-Easy5/E5/sources/kotlin/sequences/SequenceScope.java
Normal file
@ -0,0 +1,27 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
|
||||
/* compiled from: SequenceBuilder.kt */
|
||||
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0010\u001c\n\u0002\b\u0002\n\u0002\u0010(\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b'\u0018\u0000*\u0006\b\u0000\u0010\u0001 \u00002\u00020\u0002B\u0007\b\u0000¢\u0006\u0002\u0010\u0003J\u0019\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00028\u0000H¦@ø\u0001\u0000¢\u0006\u0002\u0010\u0007J\u001f\u0010\b\u001a\u00020\u00052\f\u0010\t\u001a\b\u0012\u0004\u0012\u00028\u00000\nH\u0086@ø\u0001\u0000¢\u0006\u0002\u0010\u000bJ\u001f\u0010\b\u001a\u00020\u00052\f\u0010\f\u001a\b\u0012\u0004\u0012\u00028\u00000\rH¦@ø\u0001\u0000¢\u0006\u0002\u0010\u000eJ\u001f\u0010\b\u001a\u00020\u00052\f\u0010\u000f\u001a\b\u0012\u0004\u0012\u00028\u00000\u0010H\u0086@ø\u0001\u0000¢\u0006\u0002\u0010\u0011\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u0012"}, d2 = {"Lkotlin/sequences/SequenceScope;", "T", "", "()V", "yield", "", "value", "(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "yieldAll", "elements", "", "(Ljava/lang/Iterable;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "iterator", "", "(Ljava/util/Iterator;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "sequence", "Lkotlin/sequences/Sequence;", "(Lkotlin/sequences/Sequence;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class SequenceScope<T> {
|
||||
public abstract Object yield(T t, Continuation<? super Unit> continuation);
|
||||
|
||||
public abstract Object yieldAll(Iterator<? extends T> it, Continuation<? super Unit> continuation);
|
||||
|
||||
public final Object yieldAll(Iterable<? extends T> iterable, Continuation<? super Unit> continuation) {
|
||||
Object yieldAll;
|
||||
return (!((iterable instanceof Collection) && ((Collection) iterable).isEmpty()) && (yieldAll = yieldAll(iterable.iterator(), continuation)) == IntrinsicsKt.getCOROUTINE_SUSPENDED()) ? yieldAll : Unit.INSTANCE;
|
||||
}
|
||||
|
||||
public final Object yieldAll(Sequence<? extends T> sequence, Continuation<? super Unit> continuation) {
|
||||
Object yieldAll = yieldAll(sequence.iterator(), continuation);
|
||||
return yieldAll == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? yieldAll : Unit.INSTANCE;
|
||||
}
|
||||
}
|
10
02-Easy5/E5/sources/kotlin/sequences/SequencesKt.java
Normal file
10
02-Easy5/E5/sources/kotlin/sequences/SequencesKt.java
Normal file
@ -0,0 +1,10 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"kotlin/sequences/SequencesKt__SequenceBuilderKt", "kotlin/sequences/SequencesKt__SequencesJVMKt", "kotlin/sequences/SequencesKt__SequencesKt", "kotlin/sequences/SequencesKt___SequencesJvmKt", "kotlin/sequences/SequencesKt___SequencesKt"}, k = 4, mv = {1, 8, 0}, xi = 49)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SequencesKt extends SequencesKt___SequencesKt {
|
||||
private SequencesKt() {
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* compiled from: SequenceBuilder.kt */
|
||||
@Metadata(d1 = {"\u0000:\n\u0000\n\u0002\u0010\b\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010(\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u001aM\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\n0\t\"\u0004\b\u0000\u0010\n2/\b\u0001\u0010\u000b\u001a)\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\n0\r\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u000f0\u000e\u0012\u0006\u0012\u0004\u0018\u00010\u00100\f¢\u0006\u0002\b\u0011H\u0007ø\u0001\u0000¢\u0006\u0002\u0010\u0012\u001aM\u0010\u0013\u001a\b\u0012\u0004\u0012\u0002H\n0\u0014\"\u0004\b\u0000\u0010\n2/\b\u0001\u0010\u000b\u001a)\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\n0\r\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u000f0\u000e\u0012\u0006\u0012\u0004\u0018\u00010\u00100\f¢\u0006\u0002\b\u0011H\u0007ø\u0001\u0000¢\u0006\u0002\u0010\u0015\"\u0012\u0010\u0000\u001a\u00060\u0001j\u0002`\u0002X\u0082T¢\u0006\u0002\n\u0000\"\u0012\u0010\u0003\u001a\u00060\u0001j\u0002`\u0002X\u0082T¢\u0006\u0002\n\u0000\"\u0012\u0010\u0004\u001a\u00060\u0001j\u0002`\u0002X\u0082T¢\u0006\u0002\n\u0000\"\u0012\u0010\u0005\u001a\u00060\u0001j\u0002`\u0002X\u0082T¢\u0006\u0002\n\u0000\"\u0012\u0010\u0006\u001a\u00060\u0001j\u0002`\u0002X\u0082T¢\u0006\u0002\n\u0000\"\u0012\u0010\u0007\u001a\u00060\u0001j\u0002`\u0002X\u0082T¢\u0006\u0002\n\u0000*\f\b\u0002\u0010\u0016\"\u00020\u00012\u00020\u0001\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u0017"}, d2 = {"State_Done", "", "Lkotlin/sequences/State;", "State_Failed", "State_ManyNotReady", "State_ManyReady", "State_NotReady", "State_Ready", "iterator", "", "T", "block", "Lkotlin/Function2;", "Lkotlin/sequences/SequenceScope;", "Lkotlin/coroutines/Continuation;", "", "", "Lkotlin/ExtensionFunctionType;", "(Lkotlin/jvm/functions/Function2;)Ljava/util/Iterator;", "sequence", "Lkotlin/sequences/Sequence;", "(Lkotlin/jvm/functions/Function2;)Lkotlin/sequences/Sequence;", "State", "kotlin-stdlib"}, k = 5, mv = {1, 8, 0}, xi = 49, xs = "kotlin/sequences/SequencesKt")
|
||||
/* loaded from: classes.dex */
|
||||
public class SequencesKt__SequenceBuilderKt {
|
||||
private static final int State_Done = 4;
|
||||
private static final int State_Failed = 5;
|
||||
private static final int State_ManyNotReady = 1;
|
||||
private static final int State_ManyReady = 2;
|
||||
private static final int State_NotReady = 0;
|
||||
private static final int State_Ready = 3;
|
||||
|
||||
public static final <T> Sequence<T> sequence(final Function2<? super SequenceScope<? super T>, ? super Continuation<? super Unit>, ? extends Object> block) {
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
return new Sequence<T>() { // from class: kotlin.sequences.SequencesKt__SequenceBuilderKt$sequence$$inlined$Sequence$1
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<T> iterator() {
|
||||
return SequencesKt.iterator(Function2.this);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static final <T> Iterator<T> iterator(Function2<? super SequenceScope<? super T>, ? super Continuation<? super Unit>, ? extends Object> block) {
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
SequenceBuilderIterator sequenceBuilderIterator = new SequenceBuilderIterator();
|
||||
sequenceBuilderIterator.setNextStep(IntrinsicsKt.createCoroutineUnintercepted(block, sequenceBuilderIterator, sequenceBuilderIterator));
|
||||
return sequenceBuilderIterator;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: SequencesJVM.kt */
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u001a\u001f\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u0003H\u0087\b¨\u0006\u0004"}, d2 = {"asSequence", "Lkotlin/sequences/Sequence;", "T", "Ljava/util/Enumeration;", "kotlin-stdlib"}, k = 5, mv = {1, 8, 0}, xi = 49, xs = "kotlin/sequences/SequencesKt")
|
||||
/* loaded from: classes.dex */
|
||||
class SequencesKt__SequencesJVMKt extends SequencesKt__SequenceBuilderKt {
|
||||
private static final <T> Sequence<T> asSequence(Enumeration<T> enumeration) {
|
||||
Intrinsics.checkNotNullParameter(enumeration, "<this>");
|
||||
return SequencesKt.asSequence(CollectionsKt.iterator(enumeration));
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.Boxing;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.RestrictedSuspendLambda;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [R] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0005\u001a\u00020\u0004\"\u0004\b\u0000\u0010\u0000\"\u0004\b\u0001\u0010\u0001\"\u0004\b\u0002\u0010\u0002*\b\u0012\u0004\u0012\u00028\u00020\u0003H\u008a@"}, d2 = {"T", "C", "R", "Lkotlin/sequences/SequenceScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "kotlin.sequences.SequencesKt__SequencesKt$flatMapIndexed$1", f = "Sequences.kt", i = {0, 0}, l = {332}, m = "invokeSuspend", n = {"$this$sequence", "index"}, s = {"L$0", "I$0"})
|
||||
/* loaded from: classes.dex */
|
||||
final class SequencesKt__SequencesKt$flatMapIndexed$1<R> extends RestrictedSuspendLambda implements Function2<SequenceScope<? super R>, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ Function1<C, Iterator<R>> $iterator;
|
||||
final /* synthetic */ Sequence<T> $source;
|
||||
final /* synthetic */ Function2<Integer, T, C> $transform;
|
||||
int I$0;
|
||||
private /* synthetic */ Object L$0;
|
||||
Object L$1;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
SequencesKt__SequencesKt$flatMapIndexed$1(Sequence<? extends T> sequence, Function2<? super Integer, ? super T, ? extends C> function2, Function1<? super C, ? extends Iterator<? extends R>> function1, Continuation<? super SequencesKt__SequencesKt$flatMapIndexed$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.$source = sequence;
|
||||
this.$transform = function2;
|
||||
this.$iterator = function1;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
SequencesKt__SequencesKt$flatMapIndexed$1 sequencesKt__SequencesKt$flatMapIndexed$1 = new SequencesKt__SequencesKt$flatMapIndexed$1(this.$source, this.$transform, this.$iterator, continuation);
|
||||
sequencesKt__SequencesKt$flatMapIndexed$1.L$0 = obj;
|
||||
return sequencesKt__SequencesKt$flatMapIndexed$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(SequenceScope<? super R> sequenceScope, Continuation<? super Unit> continuation) {
|
||||
return ((SequencesKt__SequencesKt$flatMapIndexed$1) create(sequenceScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
SequenceScope sequenceScope;
|
||||
Iterator it;
|
||||
int i;
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i2 = this.label;
|
||||
if (i2 == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
sequenceScope = (SequenceScope) this.L$0;
|
||||
it = this.$source.iterator();
|
||||
i = 0;
|
||||
} else {
|
||||
if (i2 != 1) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
int i3 = this.I$0;
|
||||
it = (Iterator) this.L$1;
|
||||
sequenceScope = (SequenceScope) this.L$0;
|
||||
ResultKt.throwOnFailure(obj);
|
||||
i = i3;
|
||||
}
|
||||
while (it.hasNext()) {
|
||||
Object next = it.next();
|
||||
Function2<Integer, T, C> function2 = this.$transform;
|
||||
int i4 = i + 1;
|
||||
if (i < 0) {
|
||||
CollectionsKt.throwIndexOverflow();
|
||||
}
|
||||
Object invoke = function2.invoke(Boxing.boxInt(i), next);
|
||||
this.L$0 = sequenceScope;
|
||||
this.L$1 = it;
|
||||
this.I$0 = i4;
|
||||
this.label = 1;
|
||||
if (sequenceScope.yieldAll(this.$iterator.invoke(invoke), this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
i = i4;
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.RestrictedSuspendLambda;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\b\u0012\u0004\u0012\u00028\u00000\u0001H\u008a@"}, d2 = {"T", "Lkotlin/sequences/SequenceScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "kotlin.sequences.SequencesKt__SequencesKt$ifEmpty$1", f = "Sequences.kt", i = {}, l = {69, 71}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class SequencesKt__SequencesKt$ifEmpty$1<T> extends RestrictedSuspendLambda implements Function2<SequenceScope<? super T>, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ Function0<Sequence<T>> $defaultValue;
|
||||
final /* synthetic */ Sequence<T> $this_ifEmpty;
|
||||
private /* synthetic */ Object L$0;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
SequencesKt__SequencesKt$ifEmpty$1(Sequence<? extends T> sequence, Function0<? extends Sequence<? extends T>> function0, Continuation<? super SequencesKt__SequencesKt$ifEmpty$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.$this_ifEmpty = sequence;
|
||||
this.$defaultValue = function0;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
SequencesKt__SequencesKt$ifEmpty$1 sequencesKt__SequencesKt$ifEmpty$1 = new SequencesKt__SequencesKt$ifEmpty$1(this.$this_ifEmpty, this.$defaultValue, continuation);
|
||||
sequencesKt__SequencesKt$ifEmpty$1.L$0 = obj;
|
||||
return sequencesKt__SequencesKt$ifEmpty$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(SequenceScope<? super T> sequenceScope, Continuation<? super Unit> continuation) {
|
||||
return ((SequencesKt__SequencesKt$ifEmpty$1) create(sequenceScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
SequenceScope sequenceScope = (SequenceScope) this.L$0;
|
||||
Iterator<? extends T> it = this.$this_ifEmpty.iterator();
|
||||
if (it.hasNext()) {
|
||||
this.label = 1;
|
||||
if (sequenceScope.yieldAll(it, this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
} else {
|
||||
this.label = 2;
|
||||
if (sequenceScope.yieldAll(this.$defaultValue.invoke(), this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (i != 1 && i != 2) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
ResultKt.throwOnFailure(obj);
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.RestrictedSuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.random.Random;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\b\u0012\u0004\u0012\u00028\u00000\u0001H\u008a@"}, d2 = {"T", "Lkotlin/sequences/SequenceScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "kotlin.sequences.SequencesKt__SequencesKt$shuffled$1", f = "Sequences.kt", i = {0, 0}, l = {145}, m = "invokeSuspend", n = {"$this$sequence", "buffer"}, s = {"L$0", "L$1"})
|
||||
/* loaded from: classes.dex */
|
||||
final class SequencesKt__SequencesKt$shuffled$1<T> extends RestrictedSuspendLambda implements Function2<SequenceScope<? super T>, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ Random $random;
|
||||
final /* synthetic */ Sequence<T> $this_shuffled;
|
||||
private /* synthetic */ Object L$0;
|
||||
Object L$1;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
SequencesKt__SequencesKt$shuffled$1(Sequence<? extends T> sequence, Random random, Continuation<? super SequencesKt__SequencesKt$shuffled$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.$this_shuffled = sequence;
|
||||
this.$random = random;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
SequencesKt__SequencesKt$shuffled$1 sequencesKt__SequencesKt$shuffled$1 = new SequencesKt__SequencesKt$shuffled$1(this.$this_shuffled, this.$random, continuation);
|
||||
sequencesKt__SequencesKt$shuffled$1.L$0 = obj;
|
||||
return sequencesKt__SequencesKt$shuffled$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(SequenceScope<? super T> sequenceScope, Continuation<? super Unit> continuation) {
|
||||
return ((SequencesKt__SequencesKt$shuffled$1) create(sequenceScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
List mutableList;
|
||||
SequenceScope sequenceScope;
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
SequenceScope sequenceScope2 = (SequenceScope) this.L$0;
|
||||
mutableList = SequencesKt.toMutableList(this.$this_shuffled);
|
||||
sequenceScope = sequenceScope2;
|
||||
} else {
|
||||
if (i != 1) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
mutableList = (List) this.L$1;
|
||||
SequenceScope sequenceScope3 = (SequenceScope) this.L$0;
|
||||
ResultKt.throwOnFailure(obj);
|
||||
sequenceScope = sequenceScope3;
|
||||
}
|
||||
while (!mutableList.isEmpty()) {
|
||||
int nextInt = this.$random.nextInt(mutableList.size());
|
||||
Object removeLast = CollectionsKt.removeLast(mutableList);
|
||||
if (nextInt < mutableList.size()) {
|
||||
removeLast = mutableList.set(nextInt, removeLast);
|
||||
}
|
||||
this.L$0 = sequenceScope;
|
||||
this.L$1 = mutableList;
|
||||
this.label = 1;
|
||||
if (sequenceScope.yield(removeLast, this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
@ -0,0 +1,170 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Pair;
|
||||
import kotlin.TuplesKt;
|
||||
import kotlin.collections.ArraysKt;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.random.Random;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000L\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010(\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0006\n\u0002\u0010\u0011\n\u0002\b\u0005\n\u0002\u0010\u001c\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0000\u001a.\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u00022\u0014\b\u0004\u0010\u0003\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\u00050\u0004H\u0087\bø\u0001\u0000\u001a\u0012\u0010\u0006\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002\u001ab\u0010\u0007\u001a\b\u0012\u0004\u0012\u0002H\b0\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\t\"\u0004\b\u0002\u0010\b2\f\u0010\n\u001a\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0018\u0010\u000b\u001a\u0014\u0012\u0004\u0012\u00020\r\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\t0\f2\u0018\u0010\u0003\u001a\u0014\u0012\u0004\u0012\u0002H\t\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\b0\u00050\u000eH\u0000\u001a&\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\b\b\u0000\u0010\u0002*\u00020\u00102\u000e\u0010\u0011\u001a\n\u0012\u0006\u0012\u0004\u0018\u0001H\u00020\u0004\u001a<\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\b\b\u0000\u0010\u0002*\u00020\u00102\u000e\u0010\u0012\u001a\n\u0012\u0006\u0012\u0004\u0018\u0001H\u00020\u00042\u0014\u0010\u0011\u001a\u0010\u0012\u0004\u0012\u0002H\u0002\u0012\u0006\u0012\u0004\u0018\u0001H\u00020\u000e\u001a=\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\b\b\u0000\u0010\u0002*\u00020\u00102\b\u0010\u0013\u001a\u0004\u0018\u0001H\u00022\u0014\u0010\u0011\u001a\u0010\u0012\u0004\u0012\u0002H\u0002\u0012\u0006\u0012\u0004\u0018\u0001H\u00020\u000eH\u0007¢\u0006\u0002\u0010\u0014\u001a+\u0010\u0015\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u00022\u0012\u0010\u0016\u001a\n\u0012\u0006\b\u0001\u0012\u0002H\u00020\u0017\"\u0002H\u0002¢\u0006\u0002\u0010\u0018\u001a\u001c\u0010\u0019\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u0005\u001a\u001c\u0010\u001a\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u0001\u001aC\u0010\u001b\u001a\b\u0012\u0004\u0012\u0002H\b0\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\b*\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0018\u0010\u0003\u001a\u0014\u0012\u0004\u0012\u0002H\u0002\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\b0\u00050\u000eH\u0002¢\u0006\u0002\b\u001c\u001a)\u0010\u001b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\u001d0\u0001H\u0007¢\u0006\u0002\b\u001e\u001a\"\u0010\u001b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\u00010\u0001\u001a2\u0010\u001f\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0012\u0010 \u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\u00010\u0004H\u0007\u001a!\u0010!\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0004\u0012\u0002H\u0002\u0018\u00010\u0001H\u0087\b\u001a\u001e\u0010\"\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u0001H\u0007\u001a&\u0010\"\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0006\u0010#\u001a\u00020$H\u0007\u001a@\u0010%\u001a\u001a\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020'\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\b0'0&\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\b*\u0014\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\b0&0\u0001\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006("}, d2 = {"Sequence", "Lkotlin/sequences/Sequence;", "T", "iterator", "Lkotlin/Function0;", "", "emptySequence", "flatMapIndexed", "R", "C", "source", "transform", "Lkotlin/Function2;", "", "Lkotlin/Function1;", "generateSequence", "", "nextFunction", "seedFunction", "seed", "(Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;", "sequenceOf", "elements", "", "([Ljava/lang/Object;)Lkotlin/sequences/Sequence;", "asSequence", "constrainOnce", "flatten", "flatten$SequencesKt__SequencesKt", "", "flattenSequenceOfIterable", "ifEmpty", "defaultValue", "orEmpty", "shuffled", "random", "Lkotlin/random/Random;", "unzip", "Lkotlin/Pair;", "", "kotlin-stdlib"}, k = 5, mv = {1, 8, 0}, xi = 49, xs = "kotlin/sequences/SequencesKt")
|
||||
/* loaded from: classes.dex */
|
||||
public class SequencesKt__SequencesKt extends SequencesKt__SequencesJVMKt {
|
||||
private static final <T> Sequence<T> Sequence(final Function0<? extends Iterator<? extends T>> iterator) {
|
||||
Intrinsics.checkNotNullParameter(iterator, "iterator");
|
||||
return new Sequence<T>() { // from class: kotlin.sequences.SequencesKt__SequencesKt$Sequence$1
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<T> iterator() {
|
||||
return iterator.invoke();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static final <T> Sequence<T> asSequence(final Iterator<? extends T> it) {
|
||||
Intrinsics.checkNotNullParameter(it, "<this>");
|
||||
return SequencesKt.constrainOnce(new Sequence<T>() { // from class: kotlin.sequences.SequencesKt__SequencesKt$asSequence$$inlined$Sequence$1
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<T> iterator() {
|
||||
return it;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static final <T> Sequence<T> sequenceOf(T... elements) {
|
||||
Intrinsics.checkNotNullParameter(elements, "elements");
|
||||
return elements.length == 0 ? SequencesKt.emptySequence() : ArraysKt.asSequence(elements);
|
||||
}
|
||||
|
||||
public static final <T> Sequence<T> emptySequence() {
|
||||
return EmptySequence.INSTANCE;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private static final <T> Sequence<T> orEmpty(Sequence<? extends T> sequence) {
|
||||
return sequence == 0 ? SequencesKt.emptySequence() : sequence;
|
||||
}
|
||||
|
||||
public static final <T> Sequence<T> ifEmpty(Sequence<? extends T> sequence, Function0<? extends Sequence<? extends T>> defaultValue) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Intrinsics.checkNotNullParameter(defaultValue, "defaultValue");
|
||||
return SequencesKt.sequence(new SequencesKt__SequencesKt$ifEmpty$1(sequence, defaultValue, null));
|
||||
}
|
||||
|
||||
public static final <T> Sequence<T> flatten(Sequence<? extends Sequence<? extends T>> sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
return flatten$SequencesKt__SequencesKt(sequence, new Function1<Sequence<? extends T>, Iterator<? extends T>>() { // from class: kotlin.sequences.SequencesKt__SequencesKt$flatten$1
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final Iterator<T> invoke(Sequence<? extends T> it) {
|
||||
Intrinsics.checkNotNullParameter(it, "it");
|
||||
return it.iterator();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static final <T> Sequence<T> flattenSequenceOfIterable(Sequence<? extends Iterable<? extends T>> sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
return flatten$SequencesKt__SequencesKt(sequence, new Function1<Iterable<? extends T>, Iterator<? extends T>>() { // from class: kotlin.sequences.SequencesKt__SequencesKt$flatten$2
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final Iterator<T> invoke(Iterable<? extends T> it) {
|
||||
Intrinsics.checkNotNullParameter(it, "it");
|
||||
return it.iterator();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static final <T, R> Sequence<R> flatten$SequencesKt__SequencesKt(Sequence<? extends T> sequence, Function1<? super T, ? extends Iterator<? extends R>> function1) {
|
||||
if (sequence instanceof TransformingSequence) {
|
||||
return ((TransformingSequence) sequence).flatten$kotlin_stdlib(function1);
|
||||
}
|
||||
return new FlatteningSequence(sequence, new Function1<T, T>() { // from class: kotlin.sequences.SequencesKt__SequencesKt$flatten$3
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final T invoke(T t) {
|
||||
return t;
|
||||
}
|
||||
}, function1);
|
||||
}
|
||||
|
||||
public static final <T, R> Pair<List<T>, List<R>> unzip(Sequence<? extends Pair<? extends T, ? extends R>> sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
ArrayList arrayList = new ArrayList();
|
||||
ArrayList arrayList2 = new ArrayList();
|
||||
for (Pair<? extends T, ? extends R> pair : sequence) {
|
||||
arrayList.add(pair.getFirst());
|
||||
arrayList2.add(pair.getSecond());
|
||||
}
|
||||
return TuplesKt.to(arrayList, arrayList2);
|
||||
}
|
||||
|
||||
public static final <T> Sequence<T> shuffled(Sequence<? extends T> sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
return SequencesKt.shuffled(sequence, Random.INSTANCE);
|
||||
}
|
||||
|
||||
public static final <T> Sequence<T> shuffled(Sequence<? extends T> sequence, Random random) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Intrinsics.checkNotNullParameter(random, "random");
|
||||
return SequencesKt.sequence(new SequencesKt__SequencesKt$shuffled$1(sequence, random, null));
|
||||
}
|
||||
|
||||
public static final <T, C, R> Sequence<R> flatMapIndexed(Sequence<? extends T> source, Function2<? super Integer, ? super T, ? extends C> transform, Function1<? super C, ? extends Iterator<? extends R>> iterator) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(transform, "transform");
|
||||
Intrinsics.checkNotNullParameter(iterator, "iterator");
|
||||
return SequencesKt.sequence(new SequencesKt__SequencesKt$flatMapIndexed$1(source, transform, iterator, null));
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static final <T> Sequence<T> constrainOnce(Sequence<? extends T> sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
return sequence instanceof ConstrainedOnceSequence ? sequence : new ConstrainedOnceSequence(sequence);
|
||||
}
|
||||
|
||||
public static final <T> Sequence<T> generateSequence(final Function0<? extends T> nextFunction) {
|
||||
Intrinsics.checkNotNullParameter(nextFunction, "nextFunction");
|
||||
return SequencesKt.constrainOnce(new GeneratorSequence(nextFunction, new Function1<T, T>() { // from class: kotlin.sequences.SequencesKt__SequencesKt$generateSequence$1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final T invoke(T it) {
|
||||
Intrinsics.checkNotNullParameter(it, "it");
|
||||
return nextFunction.invoke();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public static final <T> Sequence<T> generateSequence(final T t, Function1<? super T, ? extends T> nextFunction) {
|
||||
Intrinsics.checkNotNullParameter(nextFunction, "nextFunction");
|
||||
if (t == null) {
|
||||
return EmptySequence.INSTANCE;
|
||||
}
|
||||
return new GeneratorSequence(new Function0<T>() { // from class: kotlin.sequences.SequencesKt__SequencesKt$generateSequence$2
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(0);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function0
|
||||
public final T invoke() {
|
||||
return t;
|
||||
}
|
||||
}, nextFunction);
|
||||
}
|
||||
|
||||
public static final <T> Sequence<T> generateSequence(Function0<? extends T> seedFunction, Function1<? super T, ? extends T> nextFunction) {
|
||||
Intrinsics.checkNotNullParameter(seedFunction, "seedFunction");
|
||||
Intrinsics.checkNotNullParameter(nextFunction, "nextFunction");
|
||||
return new GeneratorSequence(seedFunction, nextFunction);
|
||||
}
|
||||
}
|
@ -0,0 +1,214 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecatedSinceKotlin;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: _SequencesJvm.kt */
|
||||
@Metadata(d1 = {"\u0000V\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u001f\n\u0002\b\u0004\n\u0002\u0010\u000f\n\u0000\n\u0002\u0010\u0006\n\u0000\n\u0002\u0010\u0007\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\u001a(\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\u0006\u0012\u0002\b\u00030\u00012\f\u0010\u0003\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0004\u001aA\u0010\u0005\u001a\u0002H\u0006\"\u0010\b\u0000\u0010\u0006*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u0007\"\u0004\b\u0001\u0010\u0002*\u0006\u0012\u0002\b\u00030\u00012\u0006\u0010\b\u001a\u0002H\u00062\f\u0010\u0003\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0004¢\u0006\u0002\u0010\t\u001a)\u0010\n\u001a\u0004\u0018\u0001H\u000b\"\u000e\b\u0000\u0010\u000b*\b\u0012\u0004\u0012\u0002H\u000b0\f*\b\u0012\u0004\u0012\u0002H\u000b0\u0001H\u0007¢\u0006\u0002\u0010\r\u001a\u0019\u0010\n\u001a\u0004\u0018\u00010\u000e*\b\u0012\u0004\u0012\u00020\u000e0\u0001H\u0007¢\u0006\u0002\u0010\u000f\u001a\u0019\u0010\n\u001a\u0004\u0018\u00010\u0010*\b\u0012\u0004\u0012\u00020\u00100\u0001H\u0007¢\u0006\u0002\u0010\u0011\u001aG\u0010\u0012\u001a\u0004\u0018\u0001H\u000b\"\u0004\b\u0000\u0010\u000b\"\u000e\b\u0001\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\f*\b\u0012\u0004\u0012\u0002H\u000b0\u00012\u0012\u0010\u0013\u001a\u000e\u0012\u0004\u0012\u0002H\u000b\u0012\u0004\u0012\u0002H\u00020\u0014H\u0087\bø\u0001\u0000¢\u0006\u0002\u0010\u0015\u001a;\u0010\u0016\u001a\u0004\u0018\u0001H\u000b\"\u0004\b\u0000\u0010\u000b*\b\u0012\u0004\u0012\u0002H\u000b0\u00012\u001a\u0010\u0017\u001a\u0016\u0012\u0006\b\u0000\u0012\u0002H\u000b0\u0018j\n\u0012\u0006\b\u0000\u0012\u0002H\u000b`\u0019H\u0007¢\u0006\u0002\u0010\u001a\u001a)\u0010\u001b\u001a\u0004\u0018\u0001H\u000b\"\u000e\b\u0000\u0010\u000b*\b\u0012\u0004\u0012\u0002H\u000b0\f*\b\u0012\u0004\u0012\u0002H\u000b0\u0001H\u0007¢\u0006\u0002\u0010\r\u001a\u0019\u0010\u001b\u001a\u0004\u0018\u00010\u000e*\b\u0012\u0004\u0012\u00020\u000e0\u0001H\u0007¢\u0006\u0002\u0010\u000f\u001a\u0019\u0010\u001b\u001a\u0004\u0018\u00010\u0010*\b\u0012\u0004\u0012\u00020\u00100\u0001H\u0007¢\u0006\u0002\u0010\u0011\u001aG\u0010\u001c\u001a\u0004\u0018\u0001H\u000b\"\u0004\b\u0000\u0010\u000b\"\u000e\b\u0001\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\f*\b\u0012\u0004\u0012\u0002H\u000b0\u00012\u0012\u0010\u0013\u001a\u000e\u0012\u0004\u0012\u0002H\u000b\u0012\u0004\u0012\u0002H\u00020\u0014H\u0087\bø\u0001\u0000¢\u0006\u0002\u0010\u0015\u001a;\u0010\u001d\u001a\u0004\u0018\u0001H\u000b\"\u0004\b\u0000\u0010\u000b*\b\u0012\u0004\u0012\u0002H\u000b0\u00012\u001a\u0010\u0017\u001a\u0016\u0012\u0006\b\u0000\u0012\u0002H\u000b0\u0018j\n\u0012\u0006\b\u0000\u0012\u0002H\u000b`\u0019H\u0007¢\u0006\u0002\u0010\u001a\u001a5\u0010\u001e\u001a\u00020\u001f\"\u0004\b\u0000\u0010\u000b*\b\u0012\u0004\u0012\u0002H\u000b0\u00012\u0012\u0010\u0013\u001a\u000e\u0012\u0004\u0012\u0002H\u000b\u0012\u0004\u0012\u00020\u001f0\u0014H\u0087\bø\u0001\u0000¢\u0006\u0002\b \u001a5\u0010\u001e\u001a\u00020!\"\u0004\b\u0000\u0010\u000b*\b\u0012\u0004\u0012\u0002H\u000b0\u00012\u0012\u0010\u0013\u001a\u000e\u0012\u0004\u0012\u0002H\u000b\u0012\u0004\u0012\u00020!0\u0014H\u0087\bø\u0001\u0000¢\u0006\u0002\b\"\u001a&\u0010#\u001a\b\u0012\u0004\u0012\u0002H\u000b0$\"\u000e\b\u0000\u0010\u000b*\b\u0012\u0004\u0012\u0002H\u000b0\f*\b\u0012\u0004\u0012\u0002H\u000b0\u0001\u001a8\u0010#\u001a\b\u0012\u0004\u0012\u0002H\u000b0$\"\u0004\b\u0000\u0010\u000b*\b\u0012\u0004\u0012\u0002H\u000b0\u00012\u001a\u0010\u0017\u001a\u0016\u0012\u0006\b\u0000\u0012\u0002H\u000b0\u0018j\n\u0012\u0006\b\u0000\u0012\u0002H\u000b`\u0019\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006%"}, d2 = {"filterIsInstance", "Lkotlin/sequences/Sequence;", "R", "klass", "Ljava/lang/Class;", "filterIsInstanceTo", "C", "", "destination", "(Lkotlin/sequences/Sequence;Ljava/util/Collection;Ljava/lang/Class;)Ljava/util/Collection;", "max", "T", "", "(Lkotlin/sequences/Sequence;)Ljava/lang/Comparable;", "", "(Lkotlin/sequences/Sequence;)Ljava/lang/Double;", "", "(Lkotlin/sequences/Sequence;)Ljava/lang/Float;", "maxBy", "selector", "Lkotlin/Function1;", "(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;", "maxWith", "comparator", "Ljava/util/Comparator;", "Lkotlin/Comparator;", "(Lkotlin/sequences/Sequence;Ljava/util/Comparator;)Ljava/lang/Object;", "min", "minBy", "minWith", "sumOf", "Ljava/math/BigDecimal;", "sumOfBigDecimal", "Ljava/math/BigInteger;", "sumOfBigInteger", "toSortedSet", "Ljava/util/SortedSet;", "kotlin-stdlib"}, k = 5, mv = {1, 8, 0}, xi = 49, xs = "kotlin/sequences/SequencesKt")
|
||||
/* loaded from: classes.dex */
|
||||
class SequencesKt___SequencesJvmKt extends SequencesKt__SequencesKt {
|
||||
public static final <R> Sequence<R> filterIsInstance(Sequence<?> sequence, final Class<R> klass) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Intrinsics.checkNotNullParameter(klass, "klass");
|
||||
Sequence<R> filter = SequencesKt.filter(sequence, new Function1<Object, Boolean>() { // from class: kotlin.sequences.SequencesKt___SequencesJvmKt$filterIsInstance$1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final Boolean invoke(Object obj) {
|
||||
return Boolean.valueOf(klass.isInstance(obj));
|
||||
}
|
||||
});
|
||||
Intrinsics.checkNotNull(filter, "null cannot be cast to non-null type kotlin.sequences.Sequence<R of kotlin.sequences.SequencesKt___SequencesJvmKt.filterIsInstance>");
|
||||
return filter;
|
||||
}
|
||||
|
||||
public static final <C extends Collection<? super R>, R> C filterIsInstanceTo(Sequence<?> sequence, C destination, Class<R> klass) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Intrinsics.checkNotNullParameter(destination, "destination");
|
||||
Intrinsics.checkNotNullParameter(klass, "klass");
|
||||
for (Object obj : sequence) {
|
||||
if (klass.isInstance(obj)) {
|
||||
destination.add(obj);
|
||||
}
|
||||
}
|
||||
return destination;
|
||||
}
|
||||
|
||||
public static final <T extends Comparable<? super T>> SortedSet<T> toSortedSet(Sequence<? extends T> sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
return (SortedSet) SequencesKt.toCollection(sequence, new TreeSet());
|
||||
}
|
||||
|
||||
public static final <T> SortedSet<T> toSortedSet(Sequence<? extends T> sequence, Comparator<? super T> comparator) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Intrinsics.checkNotNullParameter(comparator, "comparator");
|
||||
return (SortedSet) SequencesKt.toCollection(sequence, new TreeSet(comparator));
|
||||
}
|
||||
|
||||
@Deprecated(message = "Use maxOrNull instead.", replaceWith = @ReplaceWith(expression = "this.maxOrNull()", imports = {}))
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4")
|
||||
/* renamed from: max, reason: collision with other method in class */
|
||||
public static final /* synthetic */ Double m1596max(Sequence sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
return SequencesKt.maxOrNull(sequence);
|
||||
}
|
||||
|
||||
@Deprecated(message = "Use maxOrNull instead.", replaceWith = @ReplaceWith(expression = "this.maxOrNull()", imports = {}))
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4")
|
||||
/* renamed from: max, reason: collision with other method in class */
|
||||
public static final /* synthetic */ Float m1597max(Sequence sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
return SequencesKt.maxOrNull(sequence);
|
||||
}
|
||||
|
||||
@Deprecated(message = "Use maxOrNull instead.", replaceWith = @ReplaceWith(expression = "this.maxOrNull()", imports = {}))
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4")
|
||||
public static final /* synthetic */ Comparable max(Sequence sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
return SequencesKt.maxOrNull(sequence);
|
||||
}
|
||||
|
||||
@Deprecated(message = "Use maxWithOrNull instead.", replaceWith = @ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {}))
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4")
|
||||
public static final /* synthetic */ Object maxWith(Sequence sequence, Comparator comparator) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Intrinsics.checkNotNullParameter(comparator, "comparator");
|
||||
return SequencesKt.maxWithOrNull(sequence, comparator);
|
||||
}
|
||||
|
||||
@Deprecated(message = "Use minOrNull instead.", replaceWith = @ReplaceWith(expression = "this.minOrNull()", imports = {}))
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4")
|
||||
/* renamed from: min, reason: collision with other method in class */
|
||||
public static final /* synthetic */ Double m1598min(Sequence sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
return SequencesKt.minOrNull(sequence);
|
||||
}
|
||||
|
||||
@Deprecated(message = "Use minOrNull instead.", replaceWith = @ReplaceWith(expression = "this.minOrNull()", imports = {}))
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4")
|
||||
/* renamed from: min, reason: collision with other method in class */
|
||||
public static final /* synthetic */ Float m1599min(Sequence sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
return SequencesKt.minOrNull(sequence);
|
||||
}
|
||||
|
||||
@Deprecated(message = "Use minOrNull instead.", replaceWith = @ReplaceWith(expression = "this.minOrNull()", imports = {}))
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4")
|
||||
public static final /* synthetic */ Comparable min(Sequence sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
return SequencesKt.minOrNull(sequence);
|
||||
}
|
||||
|
||||
@Deprecated(message = "Use minWithOrNull instead.", replaceWith = @ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {}))
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4")
|
||||
public static final /* synthetic */ Object minWith(Sequence sequence, Comparator comparator) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Intrinsics.checkNotNullParameter(comparator, "comparator");
|
||||
return SequencesKt.minWithOrNull(sequence, comparator);
|
||||
}
|
||||
|
||||
private static final <T> BigDecimal sumOfBigDecimal(Sequence<? extends T> sequence, Function1<? super T, ? extends BigDecimal> selector) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Intrinsics.checkNotNullParameter(selector, "selector");
|
||||
BigDecimal valueOf = BigDecimal.valueOf(0L);
|
||||
Intrinsics.checkNotNullExpressionValue(valueOf, "valueOf(this.toLong())");
|
||||
Iterator<? extends T> it = sequence.iterator();
|
||||
while (it.hasNext()) {
|
||||
valueOf = valueOf.add(selector.invoke(it.next()));
|
||||
Intrinsics.checkNotNullExpressionValue(valueOf, "this.add(other)");
|
||||
}
|
||||
return valueOf;
|
||||
}
|
||||
|
||||
private static final <T> BigInteger sumOfBigInteger(Sequence<? extends T> sequence, Function1<? super T, ? extends BigInteger> selector) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Intrinsics.checkNotNullParameter(selector, "selector");
|
||||
BigInteger valueOf = BigInteger.valueOf(0L);
|
||||
Intrinsics.checkNotNullExpressionValue(valueOf, "valueOf(this.toLong())");
|
||||
Iterator<? extends T> it = sequence.iterator();
|
||||
while (it.hasNext()) {
|
||||
valueOf = valueOf.add(selector.invoke(it.next()));
|
||||
Intrinsics.checkNotNullExpressionValue(valueOf, "this.add(other)");
|
||||
}
|
||||
return valueOf;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Type inference failed for: r0v10 */
|
||||
/* JADX WARN: Type inference failed for: r0v11 */
|
||||
/* JADX WARN: Type inference failed for: r0v3, types: [java.lang.Object] */
|
||||
/* JADX WARN: Type inference failed for: r0v4 */
|
||||
/* JADX WARN: Type inference failed for: r0v5 */
|
||||
/* JADX WARN: Type inference failed for: r0v7 */
|
||||
@Deprecated(message = "Use maxByOrNull instead.", replaceWith = @ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {}))
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4")
|
||||
public static final /* synthetic */ <T, R extends Comparable<? super R>> T maxBy(Sequence<? extends T> sequence, Function1<? super T, ? extends R> selector) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Intrinsics.checkNotNullParameter(selector, "selector");
|
||||
Iterator<? extends T> it = sequence.iterator();
|
||||
if (!it.hasNext()) {
|
||||
return null;
|
||||
}
|
||||
T next = it.next();
|
||||
if (it.hasNext()) {
|
||||
R invoke = selector.invoke(next);
|
||||
do {
|
||||
T next2 = it.next();
|
||||
R invoke2 = selector.invoke(next2);
|
||||
next = next;
|
||||
if (invoke.compareTo(invoke2) < 0) {
|
||||
invoke = invoke2;
|
||||
next = next2;
|
||||
}
|
||||
} while (it.hasNext());
|
||||
}
|
||||
return next;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Type inference failed for: r0v10 */
|
||||
/* JADX WARN: Type inference failed for: r0v11 */
|
||||
/* JADX WARN: Type inference failed for: r0v3, types: [java.lang.Object] */
|
||||
/* JADX WARN: Type inference failed for: r0v4 */
|
||||
/* JADX WARN: Type inference failed for: r0v5 */
|
||||
/* JADX WARN: Type inference failed for: r0v7 */
|
||||
@Deprecated(message = "Use minByOrNull instead.", replaceWith = @ReplaceWith(expression = "this.minByOrNull(selector)", imports = {}))
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4")
|
||||
public static final /* synthetic */ <T, R extends Comparable<? super R>> T minBy(Sequence<? extends T> sequence, Function1<? super T, ? extends R> selector) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Intrinsics.checkNotNullParameter(selector, "selector");
|
||||
Iterator<? extends T> it = sequence.iterator();
|
||||
if (!it.hasNext()) {
|
||||
return null;
|
||||
}
|
||||
T next = it.next();
|
||||
if (it.hasNext()) {
|
||||
R invoke = selector.invoke(next);
|
||||
do {
|
||||
T next2 = it.next();
|
||||
R invoke2 = selector.invoke(next2);
|
||||
next = next;
|
||||
if (invoke.compareTo(invoke2) > 0) {
|
||||
invoke = invoke2;
|
||||
next = next2;
|
||||
}
|
||||
} while (it.hasNext());
|
||||
}
|
||||
return next;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: Iterables.kt */
|
||||
@Metadata(d1 = {"\u0000\u0011\n\u0000\n\u0002\u0010\u001c\n\u0000\n\u0002\u0010(\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001J\u000f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00028\u00000\u0003H\u0096\u0002¨\u0006\u0004¸\u0006\u0000"}, d2 = {"kotlin/collections/CollectionsKt__IterablesKt$Iterable$1", "", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SequencesKt___SequencesKt$asIterable$$inlined$Iterable$1<T> implements Iterable<T>, KMappedMarker {
|
||||
final /* synthetic */ Sequence $this_asIterable$inlined;
|
||||
|
||||
public SequencesKt___SequencesKt$asIterable$$inlined$Iterable$1(Sequence sequence) {
|
||||
this.$this_asIterable$inlined = sequence;
|
||||
}
|
||||
|
||||
@Override // java.lang.Iterable
|
||||
public Iterator<T> iterator() {
|
||||
return this.$this_asIterable$inlined.iterator();
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.FunctionReferenceImpl;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [R] */
|
||||
/* compiled from: _Sequences.kt */
|
||||
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
/* synthetic */ class SequencesKt___SequencesKt$flatMap$1<R> extends FunctionReferenceImpl implements Function1<Iterable<? extends R>, Iterator<? extends R>> {
|
||||
public static final SequencesKt___SequencesKt$flatMap$1 INSTANCE = new SequencesKt___SequencesKt$flatMap$1();
|
||||
|
||||
SequencesKt___SequencesKt$flatMap$1() {
|
||||
super(1, Iterable.class, "iterator", "iterator()Ljava/util/Iterator;", 0);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final Iterator<R> invoke(Iterable<? extends R> p0) {
|
||||
Intrinsics.checkNotNullParameter(p0, "p0");
|
||||
return p0.iterator();
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.FunctionReferenceImpl;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [R] */
|
||||
/* compiled from: _Sequences.kt */
|
||||
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
/* synthetic */ class SequencesKt___SequencesKt$flatMap$2<R> extends FunctionReferenceImpl implements Function1<Sequence<? extends R>, Iterator<? extends R>> {
|
||||
public static final SequencesKt___SequencesKt$flatMap$2 INSTANCE = new SequencesKt___SequencesKt$flatMap$2();
|
||||
|
||||
SequencesKt___SequencesKt$flatMap$2() {
|
||||
super(1, Sequence.class, "iterator", "iterator()Ljava/util/Iterator;", 0);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final Iterator<R> invoke(Sequence<? extends R> p0) {
|
||||
Intrinsics.checkNotNullParameter(p0, "p0");
|
||||
return p0.iterator();
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.FunctionReferenceImpl;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [R] */
|
||||
/* compiled from: _Sequences.kt */
|
||||
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
/* synthetic */ class SequencesKt___SequencesKt$flatMapIndexed$1<R> extends FunctionReferenceImpl implements Function1<Iterable<? extends R>, Iterator<? extends R>> {
|
||||
public static final SequencesKt___SequencesKt$flatMapIndexed$1 INSTANCE = new SequencesKt___SequencesKt$flatMapIndexed$1();
|
||||
|
||||
SequencesKt___SequencesKt$flatMapIndexed$1() {
|
||||
super(1, Iterable.class, "iterator", "iterator()Ljava/util/Iterator;", 0);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final Iterator<R> invoke(Iterable<? extends R> p0) {
|
||||
Intrinsics.checkNotNullParameter(p0, "p0");
|
||||
return p0.iterator();
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.FunctionReferenceImpl;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [R] */
|
||||
/* compiled from: _Sequences.kt */
|
||||
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
/* synthetic */ class SequencesKt___SequencesKt$flatMapIndexed$2<R> extends FunctionReferenceImpl implements Function1<Sequence<? extends R>, Iterator<? extends R>> {
|
||||
public static final SequencesKt___SequencesKt$flatMapIndexed$2 INSTANCE = new SequencesKt___SequencesKt$flatMapIndexed$2();
|
||||
|
||||
SequencesKt___SequencesKt$flatMapIndexed$2() {
|
||||
super(1, Sequence.class, "iterator", "iterator()Ljava/util/Iterator;", 0);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final Iterator<R> invoke(Sequence<? extends R> p0) {
|
||||
Intrinsics.checkNotNullParameter(p0, "p0");
|
||||
return p0.iterator();
|
||||
}
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.RestrictedSuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [R] */
|
||||
/* compiled from: _Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0004\u001a\u00020\u0003\"\u0004\b\u0000\u0010\u0000\"\u0004\b\u0001\u0010\u0001*\b\u0012\u0004\u0012\u00028\u00010\u0002H\u008a@"}, d2 = {"T", "R", "Lkotlin/sequences/SequenceScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "kotlin.sequences.SequencesKt___SequencesKt$runningFold$1", f = "_Sequences.kt", i = {0, 1, 1}, l = {2290, 2294}, m = "invokeSuspend", n = {"$this$sequence", "$this$sequence", "accumulator"}, s = {"L$0", "L$0", "L$1"})
|
||||
/* loaded from: classes.dex */
|
||||
final class SequencesKt___SequencesKt$runningFold$1<R> extends RestrictedSuspendLambda implements Function2<SequenceScope<? super R>, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ R $initial;
|
||||
final /* synthetic */ Function2<R, T, R> $operation;
|
||||
final /* synthetic */ Sequence<T> $this_runningFold;
|
||||
private /* synthetic */ Object L$0;
|
||||
Object L$1;
|
||||
Object L$2;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
SequencesKt___SequencesKt$runningFold$1(R r, Sequence<? extends T> sequence, Function2<? super R, ? super T, ? extends R> function2, Continuation<? super SequencesKt___SequencesKt$runningFold$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.$initial = r;
|
||||
this.$this_runningFold = sequence;
|
||||
this.$operation = function2;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
SequencesKt___SequencesKt$runningFold$1 sequencesKt___SequencesKt$runningFold$1 = new SequencesKt___SequencesKt$runningFold$1(this.$initial, this.$this_runningFold, this.$operation, continuation);
|
||||
sequencesKt___SequencesKt$runningFold$1.L$0 = obj;
|
||||
return sequencesKt___SequencesKt$runningFold$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(SequenceScope<? super R> sequenceScope, Continuation<? super Unit> continuation) {
|
||||
return ((SequencesKt___SequencesKt$runningFold$1) create(sequenceScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Removed duplicated region for block: B:9:0x0056 */
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public final java.lang.Object invokeSuspend(java.lang.Object r8) {
|
||||
/*
|
||||
r7 = this;
|
||||
java.lang.Object r0 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
|
||||
int r1 = r7.label
|
||||
r2 = 2
|
||||
r3 = 1
|
||||
if (r1 == 0) goto L2d
|
||||
if (r1 == r3) goto L25
|
||||
if (r1 != r2) goto L1d
|
||||
java.lang.Object r1 = r7.L$2
|
||||
java.util.Iterator r1 = (java.util.Iterator) r1
|
||||
java.lang.Object r3 = r7.L$1
|
||||
java.lang.Object r4 = r7.L$0
|
||||
kotlin.sequences.SequenceScope r4 = (kotlin.sequences.SequenceScope) r4
|
||||
kotlin.ResultKt.throwOnFailure(r8)
|
||||
r8 = r3
|
||||
goto L4f
|
||||
L1d:
|
||||
java.lang.IllegalStateException r8 = new java.lang.IllegalStateException
|
||||
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
|
||||
r8.<init>(r0)
|
||||
throw r8
|
||||
L25:
|
||||
java.lang.Object r1 = r7.L$0
|
||||
kotlin.sequences.SequenceScope r1 = (kotlin.sequences.SequenceScope) r1
|
||||
kotlin.ResultKt.throwOnFailure(r8)
|
||||
goto L45
|
||||
L2d:
|
||||
kotlin.ResultKt.throwOnFailure(r8)
|
||||
java.lang.Object r8 = r7.L$0
|
||||
r1 = r8
|
||||
kotlin.sequences.SequenceScope r1 = (kotlin.sequences.SequenceScope) r1
|
||||
R r8 = r7.$initial
|
||||
r4 = r7
|
||||
kotlin.coroutines.Continuation r4 = (kotlin.coroutines.Continuation) r4
|
||||
r7.L$0 = r1
|
||||
r7.label = r3
|
||||
java.lang.Object r8 = r1.yield(r8, r4)
|
||||
if (r8 != r0) goto L45
|
||||
return r0
|
||||
L45:
|
||||
R r8 = r7.$initial
|
||||
kotlin.sequences.Sequence<T> r3 = r7.$this_runningFold
|
||||
java.util.Iterator r3 = r3.iterator()
|
||||
r4 = r1
|
||||
r1 = r3
|
||||
L4f:
|
||||
r3 = r7
|
||||
L50:
|
||||
boolean r5 = r1.hasNext()
|
||||
if (r5 == 0) goto L72
|
||||
java.lang.Object r5 = r1.next()
|
||||
kotlin.jvm.functions.Function2<R, T, R> r6 = r3.$operation
|
||||
java.lang.Object r8 = r6.invoke(r8, r5)
|
||||
r5 = r3
|
||||
kotlin.coroutines.Continuation r5 = (kotlin.coroutines.Continuation) r5
|
||||
r3.L$0 = r4
|
||||
r3.L$1 = r8
|
||||
r3.L$2 = r1
|
||||
r3.label = r2
|
||||
java.lang.Object r5 = r4.yield(r8, r5)
|
||||
if (r5 != r0) goto L50
|
||||
return r0
|
||||
L72:
|
||||
kotlin.Unit r8 = kotlin.Unit.INSTANCE
|
||||
return r8
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.sequences.SequencesKt___SequencesKt$runningFold$1.invokeSuspend(java.lang.Object):java.lang.Object");
|
||||
}
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.RestrictedSuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.functions.Function3;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [R] */
|
||||
/* compiled from: _Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0004\u001a\u00020\u0003\"\u0004\b\u0000\u0010\u0000\"\u0004\b\u0001\u0010\u0001*\b\u0012\u0004\u0012\u00028\u00010\u0002H\u008a@"}, d2 = {"T", "R", "Lkotlin/sequences/SequenceScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "kotlin.sequences.SequencesKt___SequencesKt$runningFoldIndexed$1", f = "_Sequences.kt", i = {0, 1, 1, 1}, l = {2318, 2323}, m = "invokeSuspend", n = {"$this$sequence", "$this$sequence", "accumulator", "index"}, s = {"L$0", "L$0", "L$1", "I$0"})
|
||||
/* loaded from: classes.dex */
|
||||
final class SequencesKt___SequencesKt$runningFoldIndexed$1<R> extends RestrictedSuspendLambda implements Function2<SequenceScope<? super R>, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ R $initial;
|
||||
final /* synthetic */ Function3<Integer, R, T, R> $operation;
|
||||
final /* synthetic */ Sequence<T> $this_runningFoldIndexed;
|
||||
int I$0;
|
||||
private /* synthetic */ Object L$0;
|
||||
Object L$1;
|
||||
Object L$2;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
SequencesKt___SequencesKt$runningFoldIndexed$1(R r, Sequence<? extends T> sequence, Function3<? super Integer, ? super R, ? super T, ? extends R> function3, Continuation<? super SequencesKt___SequencesKt$runningFoldIndexed$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.$initial = r;
|
||||
this.$this_runningFoldIndexed = sequence;
|
||||
this.$operation = function3;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
SequencesKt___SequencesKt$runningFoldIndexed$1 sequencesKt___SequencesKt$runningFoldIndexed$1 = new SequencesKt___SequencesKt$runningFoldIndexed$1(this.$initial, this.$this_runningFoldIndexed, this.$operation, continuation);
|
||||
sequencesKt___SequencesKt$runningFoldIndexed$1.L$0 = obj;
|
||||
return sequencesKt___SequencesKt$runningFoldIndexed$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(SequenceScope<? super R> sequenceScope, Continuation<? super Unit> continuation) {
|
||||
return ((SequencesKt___SequencesKt$runningFoldIndexed$1) create(sequenceScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Removed duplicated region for block: B:9:0x0059 */
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public final java.lang.Object invokeSuspend(java.lang.Object r10) {
|
||||
/*
|
||||
r9 = this;
|
||||
java.lang.Object r0 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
|
||||
int r1 = r9.label
|
||||
r2 = 2
|
||||
r3 = 1
|
||||
if (r1 == 0) goto L30
|
||||
if (r1 == r3) goto L28
|
||||
if (r1 != r2) goto L20
|
||||
int r1 = r9.I$0
|
||||
java.lang.Object r3 = r9.L$2
|
||||
java.util.Iterator r3 = (java.util.Iterator) r3
|
||||
java.lang.Object r4 = r9.L$1
|
||||
java.lang.Object r5 = r9.L$0
|
||||
kotlin.sequences.SequenceScope r5 = (kotlin.sequences.SequenceScope) r5
|
||||
kotlin.ResultKt.throwOnFailure(r10)
|
||||
r10 = r4
|
||||
r4 = r1
|
||||
goto L52
|
||||
L20:
|
||||
java.lang.IllegalStateException r10 = new java.lang.IllegalStateException
|
||||
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
|
||||
r10.<init>(r0)
|
||||
throw r10
|
||||
L28:
|
||||
java.lang.Object r1 = r9.L$0
|
||||
kotlin.sequences.SequenceScope r1 = (kotlin.sequences.SequenceScope) r1
|
||||
kotlin.ResultKt.throwOnFailure(r10)
|
||||
goto L48
|
||||
L30:
|
||||
kotlin.ResultKt.throwOnFailure(r10)
|
||||
java.lang.Object r10 = r9.L$0
|
||||
r1 = r10
|
||||
kotlin.sequences.SequenceScope r1 = (kotlin.sequences.SequenceScope) r1
|
||||
R r10 = r9.$initial
|
||||
r4 = r9
|
||||
kotlin.coroutines.Continuation r4 = (kotlin.coroutines.Continuation) r4
|
||||
r9.L$0 = r1
|
||||
r9.label = r3
|
||||
java.lang.Object r10 = r1.yield(r10, r4)
|
||||
if (r10 != r0) goto L48
|
||||
return r0
|
||||
L48:
|
||||
R r10 = r9.$initial
|
||||
kotlin.sequences.Sequence<T> r3 = r9.$this_runningFoldIndexed
|
||||
java.util.Iterator r3 = r3.iterator()
|
||||
r4 = 0
|
||||
r5 = r1
|
||||
L52:
|
||||
r1 = r9
|
||||
L53:
|
||||
boolean r6 = r3.hasNext()
|
||||
if (r6 == 0) goto L85
|
||||
java.lang.Object r6 = r3.next()
|
||||
kotlin.jvm.functions.Function3<java.lang.Integer, R, T, R> r7 = r1.$operation
|
||||
int r8 = r4 + 1
|
||||
if (r4 >= 0) goto L66
|
||||
kotlin.collections.CollectionsKt.throwIndexOverflow()
|
||||
L66:
|
||||
java.lang.Integer r4 = kotlin.coroutines.jvm.internal.Boxing.boxInt(r4)
|
||||
java.lang.Object r4 = r7.invoke(r4, r10, r6)
|
||||
r10 = r1
|
||||
kotlin.coroutines.Continuation r10 = (kotlin.coroutines.Continuation) r10
|
||||
r1.L$0 = r5
|
||||
r1.L$1 = r4
|
||||
r1.L$2 = r3
|
||||
r1.I$0 = r8
|
||||
r1.label = r2
|
||||
java.lang.Object r10 = r5.yield(r4, r10)
|
||||
if (r10 != r0) goto L82
|
||||
return r0
|
||||
L82:
|
||||
r10 = r4
|
||||
r4 = r8
|
||||
goto L53
|
||||
L85:
|
||||
kotlin.Unit r10 = kotlin.Unit.INSTANCE
|
||||
return r10
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.sequences.SequencesKt___SequencesKt$runningFoldIndexed$1.invokeSuspend(java.lang.Object):java.lang.Object");
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.RestrictedSuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [S] */
|
||||
/* compiled from: _Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0004\u001a\u00020\u0003\"\u0004\b\u0000\u0010\u0000\"\b\b\u0001\u0010\u0001*\u00028\u0000*\b\u0012\u0004\u0012\u00028\u00000\u0002H\u008a@"}, d2 = {"S", "T", "Lkotlin/sequences/SequenceScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "kotlin.sequences.SequencesKt___SequencesKt$runningReduce$1", f = "_Sequences.kt", i = {0, 0, 0, 1, 1, 1}, l = {2348, 2351}, m = "invokeSuspend", n = {"$this$sequence", "iterator", "accumulator", "$this$sequence", "iterator", "accumulator"}, s = {"L$0", "L$1", "L$2", "L$0", "L$1", "L$2"})
|
||||
/* loaded from: classes.dex */
|
||||
final class SequencesKt___SequencesKt$runningReduce$1<S> extends RestrictedSuspendLambda implements Function2<SequenceScope<? super S>, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ Function2<S, T, S> $operation;
|
||||
final /* synthetic */ Sequence<T> $this_runningReduce;
|
||||
private /* synthetic */ Object L$0;
|
||||
Object L$1;
|
||||
Object L$2;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
SequencesKt___SequencesKt$runningReduce$1(Sequence<? extends T> sequence, Function2<? super S, ? super T, ? extends S> function2, Continuation<? super SequencesKt___SequencesKt$runningReduce$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.$this_runningReduce = sequence;
|
||||
this.$operation = function2;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
SequencesKt___SequencesKt$runningReduce$1 sequencesKt___SequencesKt$runningReduce$1 = new SequencesKt___SequencesKt$runningReduce$1(this.$this_runningReduce, this.$operation, continuation);
|
||||
sequencesKt___SequencesKt$runningReduce$1.L$0 = obj;
|
||||
return sequencesKt___SequencesKt$runningReduce$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(SequenceScope<? super S> sequenceScope, Continuation<? super Unit> continuation) {
|
||||
return ((SequencesKt___SequencesKt$runningReduce$1) create(sequenceScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
SequenceScope sequenceScope;
|
||||
Object next;
|
||||
Iterator it;
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
sequenceScope = (SequenceScope) this.L$0;
|
||||
Iterator it2 = this.$this_runningReduce.iterator();
|
||||
if (it2.hasNext()) {
|
||||
next = it2.next();
|
||||
this.L$0 = sequenceScope;
|
||||
this.L$1 = it2;
|
||||
this.L$2 = next;
|
||||
this.label = 1;
|
||||
if (sequenceScope.yield(next, this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
it = it2;
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
if (i != 1 && i != 2) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
next = this.L$2;
|
||||
it = (Iterator) this.L$1;
|
||||
sequenceScope = (SequenceScope) this.L$0;
|
||||
ResultKt.throwOnFailure(obj);
|
||||
while (it.hasNext()) {
|
||||
next = this.$operation.invoke(next, it.next());
|
||||
this.L$0 = sequenceScope;
|
||||
this.L$1 = it;
|
||||
this.L$2 = next;
|
||||
this.label = 2;
|
||||
if (sequenceScope.yield(next, this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.RestrictedSuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.functions.Function3;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [S] */
|
||||
/* compiled from: _Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0004\u001a\u00020\u0003\"\u0004\b\u0000\u0010\u0000\"\b\b\u0001\u0010\u0001*\u00028\u0000*\b\u0012\u0004\u0012\u00028\u00000\u0002H\u008a@"}, d2 = {"S", "T", "Lkotlin/sequences/SequenceScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "kotlin.sequences.SequencesKt___SequencesKt$runningReduceIndexed$1", f = "_Sequences.kt", i = {0, 0, 0, 1, 1, 1, 1}, l = {2377, 2381}, m = "invokeSuspend", n = {"$this$sequence", "iterator", "accumulator", "$this$sequence", "iterator", "accumulator", "index"}, s = {"L$0", "L$1", "L$2", "L$0", "L$1", "L$2", "I$0"})
|
||||
/* loaded from: classes.dex */
|
||||
final class SequencesKt___SequencesKt$runningReduceIndexed$1<S> extends RestrictedSuspendLambda implements Function2<SequenceScope<? super S>, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ Function3<Integer, S, T, S> $operation;
|
||||
final /* synthetic */ Sequence<T> $this_runningReduceIndexed;
|
||||
int I$0;
|
||||
private /* synthetic */ Object L$0;
|
||||
Object L$1;
|
||||
Object L$2;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
SequencesKt___SequencesKt$runningReduceIndexed$1(Sequence<? extends T> sequence, Function3<? super Integer, ? super S, ? super T, ? extends S> function3, Continuation<? super SequencesKt___SequencesKt$runningReduceIndexed$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.$this_runningReduceIndexed = sequence;
|
||||
this.$operation = function3;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
SequencesKt___SequencesKt$runningReduceIndexed$1 sequencesKt___SequencesKt$runningReduceIndexed$1 = new SequencesKt___SequencesKt$runningReduceIndexed$1(this.$this_runningReduceIndexed, this.$operation, continuation);
|
||||
sequencesKt___SequencesKt$runningReduceIndexed$1.L$0 = obj;
|
||||
return sequencesKt___SequencesKt$runningReduceIndexed$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(SequenceScope<? super S> sequenceScope, Continuation<? super Unit> continuation) {
|
||||
return ((SequencesKt___SequencesKt$runningReduceIndexed$1) create(sequenceScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Removed duplicated region for block: B:9:0x0069 */
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public final java.lang.Object invokeSuspend(java.lang.Object r11) {
|
||||
/*
|
||||
r10 = this;
|
||||
java.lang.Object r0 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
|
||||
int r1 = r10.label
|
||||
r2 = 2
|
||||
r3 = 1
|
||||
if (r1 == 0) goto L38
|
||||
if (r1 == r3) goto L2a
|
||||
if (r1 != r2) goto L22
|
||||
int r1 = r10.I$0
|
||||
java.lang.Object r3 = r10.L$2
|
||||
java.lang.Object r4 = r10.L$1
|
||||
java.util.Iterator r4 = (java.util.Iterator) r4
|
||||
java.lang.Object r5 = r10.L$0
|
||||
kotlin.sequences.SequenceScope r5 = (kotlin.sequences.SequenceScope) r5
|
||||
kotlin.ResultKt.throwOnFailure(r11)
|
||||
r11 = r10
|
||||
r9 = r3
|
||||
r3 = r1
|
||||
r1 = r9
|
||||
goto L63
|
||||
L22:
|
||||
java.lang.IllegalStateException r11 = new java.lang.IllegalStateException
|
||||
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
|
||||
r11.<init>(r0)
|
||||
throw r11
|
||||
L2a:
|
||||
java.lang.Object r1 = r10.L$2
|
||||
java.lang.Object r4 = r10.L$1
|
||||
java.util.Iterator r4 = (java.util.Iterator) r4
|
||||
java.lang.Object r5 = r10.L$0
|
||||
kotlin.sequences.SequenceScope r5 = (kotlin.sequences.SequenceScope) r5
|
||||
kotlin.ResultKt.throwOnFailure(r11)
|
||||
goto L62
|
||||
L38:
|
||||
kotlin.ResultKt.throwOnFailure(r11)
|
||||
java.lang.Object r11 = r10.L$0
|
||||
r5 = r11
|
||||
kotlin.sequences.SequenceScope r5 = (kotlin.sequences.SequenceScope) r5
|
||||
kotlin.sequences.Sequence<T> r11 = r10.$this_runningReduceIndexed
|
||||
java.util.Iterator r4 = r11.iterator()
|
||||
boolean r11 = r4.hasNext()
|
||||
if (r11 == 0) goto L95
|
||||
java.lang.Object r1 = r4.next()
|
||||
r11 = r10
|
||||
kotlin.coroutines.Continuation r11 = (kotlin.coroutines.Continuation) r11
|
||||
r10.L$0 = r5
|
||||
r10.L$1 = r4
|
||||
r10.L$2 = r1
|
||||
r10.label = r3
|
||||
java.lang.Object r11 = r5.yield(r1, r11)
|
||||
if (r11 != r0) goto L62
|
||||
return r0
|
||||
L62:
|
||||
r11 = r10
|
||||
L63:
|
||||
boolean r6 = r4.hasNext()
|
||||
if (r6 == 0) goto L95
|
||||
kotlin.jvm.functions.Function3<java.lang.Integer, S, T, S> r6 = r11.$operation
|
||||
int r7 = r3 + 1
|
||||
if (r3 >= 0) goto L72
|
||||
kotlin.collections.CollectionsKt.throwIndexOverflow()
|
||||
L72:
|
||||
java.lang.Integer r3 = kotlin.coroutines.jvm.internal.Boxing.boxInt(r3)
|
||||
java.lang.Object r8 = r4.next()
|
||||
java.lang.Object r3 = r6.invoke(r3, r1, r8)
|
||||
r1 = r11
|
||||
kotlin.coroutines.Continuation r1 = (kotlin.coroutines.Continuation) r1
|
||||
r11.L$0 = r5
|
||||
r11.L$1 = r4
|
||||
r11.L$2 = r3
|
||||
r11.I$0 = r7
|
||||
r11.label = r2
|
||||
java.lang.Object r1 = r5.yield(r3, r1)
|
||||
if (r1 != r0) goto L92
|
||||
return r0
|
||||
L92:
|
||||
r1 = r3
|
||||
r3 = r7
|
||||
goto L63
|
||||
L95:
|
||||
kotlin.Unit r11 = kotlin.Unit.INSTANCE
|
||||
return r11
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.sequences.SequencesKt___SequencesKt$runningReduceIndexed$1.invokeSuspend(java.lang.Object):java.lang.Object");
|
||||
}
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.RestrictedSuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [R] */
|
||||
/* compiled from: _Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0004\u001a\u00020\u0003\"\u0004\b\u0000\u0010\u0000\"\u0004\b\u0001\u0010\u0001*\b\u0012\u0004\u0012\u00028\u00010\u0002H\u008a@"}, d2 = {"T", "R", "Lkotlin/sequences/SequenceScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "kotlin.sequences.SequencesKt___SequencesKt$zipWithNext$2", f = "_Sequences.kt", i = {0, 0, 0}, l = {2855}, m = "invokeSuspend", n = {"$this$result", "iterator", "next"}, s = {"L$0", "L$1", "L$2"})
|
||||
/* loaded from: classes.dex */
|
||||
final class SequencesKt___SequencesKt$zipWithNext$2<R> extends RestrictedSuspendLambda implements Function2<SequenceScope<? super R>, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ Sequence<T> $this_zipWithNext;
|
||||
final /* synthetic */ Function2<T, T, R> $transform;
|
||||
private /* synthetic */ Object L$0;
|
||||
Object L$1;
|
||||
Object L$2;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
SequencesKt___SequencesKt$zipWithNext$2(Sequence<? extends T> sequence, Function2<? super T, ? super T, ? extends R> function2, Continuation<? super SequencesKt___SequencesKt$zipWithNext$2> continuation) {
|
||||
super(2, continuation);
|
||||
this.$this_zipWithNext = sequence;
|
||||
this.$transform = function2;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
SequencesKt___SequencesKt$zipWithNext$2 sequencesKt___SequencesKt$zipWithNext$2 = new SequencesKt___SequencesKt$zipWithNext$2(this.$this_zipWithNext, this.$transform, continuation);
|
||||
sequencesKt___SequencesKt$zipWithNext$2.L$0 = obj;
|
||||
return sequencesKt___SequencesKt$zipWithNext$2;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(SequenceScope<? super R> sequenceScope, Continuation<? super Unit> continuation) {
|
||||
return ((SequencesKt___SequencesKt$zipWithNext$2) create(sequenceScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
SequenceScope sequenceScope;
|
||||
Object next;
|
||||
Iterator it;
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
SequenceScope sequenceScope2 = (SequenceScope) this.L$0;
|
||||
Iterator it2 = this.$this_zipWithNext.iterator();
|
||||
if (!it2.hasNext()) {
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
sequenceScope = sequenceScope2;
|
||||
next = it2.next();
|
||||
it = it2;
|
||||
} else {
|
||||
if (i != 1) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
Object obj2 = this.L$2;
|
||||
it = (Iterator) this.L$1;
|
||||
sequenceScope = (SequenceScope) this.L$0;
|
||||
ResultKt.throwOnFailure(obj);
|
||||
next = obj2;
|
||||
}
|
||||
while (it.hasNext()) {
|
||||
Object next2 = it.next();
|
||||
this.L$0 = sequenceScope;
|
||||
this.L$1 = it;
|
||||
this.L$2 = next2;
|
||||
this.label = 1;
|
||||
if (sequenceScope.yield(this.$transform.invoke(next, next2), this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
next = next2;
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
2487
02-Easy5/E5/sources/kotlin/sequences/SequencesKt___SequencesKt.java
Normal file
2487
02-Easy5/E5/sources/kotlin/sequences/SequencesKt___SequencesKt.java
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,90 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000#\n\u0000\n\u0002\u0010(\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001J\b\u0010\u000b\u001a\u00020\fH\u0002J\t\u0010\r\u001a\u00020\u000eH\u0096\u0002J\u000e\u0010\u000f\u001a\u00028\u0000H\u0096\u0002¢\u0006\u0002\u0010\u0010R\u0017\u0010\u0002\u001a\b\u0012\u0004\u0012\u00028\u00000\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0003\u0010\u0004R\u001a\u0010\u0005\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\n¨\u0006\u0011"}, d2 = {"kotlin/sequences/SubSequence$iterator$1", "", "iterator", "getIterator", "()Ljava/util/Iterator;", "position", "", "getPosition", "()I", "setPosition", "(I)V", "drop", "", "hasNext", "", "next", "()Ljava/lang/Object;", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SubSequence$iterator$1<T> implements Iterator<T>, KMappedMarker {
|
||||
private final Iterator<T> iterator;
|
||||
private int position;
|
||||
final /* synthetic */ SubSequence<T> this$0;
|
||||
|
||||
public final Iterator<T> getIterator() {
|
||||
return this.iterator;
|
||||
}
|
||||
|
||||
public final int getPosition() {
|
||||
return this.position;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
public final void setPosition(int i) {
|
||||
this.position = i;
|
||||
}
|
||||
|
||||
SubSequence$iterator$1(SubSequence<T> subSequence) {
|
||||
Sequence sequence;
|
||||
this.this$0 = subSequence;
|
||||
sequence = ((SubSequence) subSequence).sequence;
|
||||
this.iterator = sequence.iterator();
|
||||
}
|
||||
|
||||
/* JADX WARN: Incorrect condition in loop: B:2:0x0008 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
private final void drop() {
|
||||
/*
|
||||
r2 = this;
|
||||
L0:
|
||||
int r0 = r2.position
|
||||
kotlin.sequences.SubSequence<T> r1 = r2.this$0
|
||||
int r1 = kotlin.sequences.SubSequence.access$getStartIndex$p(r1)
|
||||
if (r0 >= r1) goto L1e
|
||||
java.util.Iterator<T> r0 = r2.iterator
|
||||
boolean r0 = r0.hasNext()
|
||||
if (r0 == 0) goto L1e
|
||||
java.util.Iterator<T> r0 = r2.iterator
|
||||
r0.next()
|
||||
int r0 = r2.position
|
||||
int r0 = r0 + 1
|
||||
r2.position = r0
|
||||
goto L0
|
||||
L1e:
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.sequences.SubSequence$iterator$1.drop():void");
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
int i;
|
||||
drop();
|
||||
int i2 = this.position;
|
||||
i = ((SubSequence) this.this$0).endIndex;
|
||||
return i2 < i && this.iterator.hasNext();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public T next() {
|
||||
int i;
|
||||
drop();
|
||||
int i2 = this.position;
|
||||
i = ((SubSequence) this.this$0).endIndex;
|
||||
if (i2 >= i) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
this.position++;
|
||||
return this.iterator.next();
|
||||
}
|
||||
}
|
56
02-Easy5/E5/sources/kotlin/sequences/SubSequence.java
Normal file
56
02-Easy5/E5/sources/kotlin/sequences/SubSequence.java
Normal file
@ -0,0 +1,56 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\b\n\u0002\u0010(\n\u0002\b\u0002\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u00022\b\u0012\u0004\u0012\u0002H\u00010\u0003B#\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002\u0012\u0006\u0010\u0005\u001a\u00020\u0006\u0012\u0006\u0010\u0007\u001a\u00020\u0006¢\u0006\u0002\u0010\bJ\u0016\u0010\f\u001a\b\u0012\u0004\u0012\u00028\u00000\u00022\u0006\u0010\r\u001a\u00020\u0006H\u0016J\u000f\u0010\u000e\u001a\b\u0012\u0004\u0012\u00028\u00000\u000fH\u0096\u0002J\u0016\u0010\u0010\u001a\b\u0012\u0004\u0012\u00028\u00000\u00022\u0006\u0010\r\u001a\u00020\u0006H\u0016R\u0014\u0010\t\u001a\u00020\u00068BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\n\u0010\u000bR\u000e\u0010\u0007\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0011"}, d2 = {"Lkotlin/sequences/SubSequence;", "T", "Lkotlin/sequences/Sequence;", "Lkotlin/sequences/DropTakeSequence;", "sequence", "startIndex", "", "endIndex", "(Lkotlin/sequences/Sequence;II)V", "count", "getCount", "()I", "drop", "n", "iterator", "", "take", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SubSequence<T> implements Sequence<T>, DropTakeSequence<T> {
|
||||
private final int endIndex;
|
||||
private final Sequence<T> sequence;
|
||||
private final int startIndex;
|
||||
|
||||
private final int getCount() {
|
||||
return this.endIndex - this.startIndex;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public SubSequence(Sequence<? extends T> sequence, int i, int i2) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "sequence");
|
||||
this.sequence = sequence;
|
||||
this.startIndex = i;
|
||||
this.endIndex = i2;
|
||||
if (i < 0) {
|
||||
throw new IllegalArgumentException(("startIndex should be non-negative, but is " + i).toString());
|
||||
}
|
||||
if (i2 < 0) {
|
||||
throw new IllegalArgumentException(("endIndex should be non-negative, but is " + i2).toString());
|
||||
}
|
||||
if (i2 >= i) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException(("endIndex should be not less than startIndex, but was " + i2 + " < " + i).toString());
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.DropTakeSequence
|
||||
public Sequence<T> drop(int n) {
|
||||
return n >= getCount() ? SequencesKt.emptySequence() : new SubSequence(this.sequence, this.startIndex + n, this.endIndex);
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.DropTakeSequence
|
||||
public Sequence<T> take(int n) {
|
||||
if (n >= getCount()) {
|
||||
return this;
|
||||
}
|
||||
Sequence<T> sequence = this.sequence;
|
||||
int i = this.startIndex;
|
||||
return new SubSequence(sequence, i, n + i);
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<T> iterator() {
|
||||
return new SubSequence$iterator$1(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u001d\n\u0000\n\u0002\u0010(\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001J\t\u0010\u000b\u001a\u00020\fH\u0096\u0002J\u000e\u0010\r\u001a\u00028\u0000H\u0096\u0002¢\u0006\u0002\u0010\u000eR\u0017\u0010\u0002\u001a\b\u0012\u0004\u0012\u00028\u00000\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0003\u0010\u0004R\u001a\u0010\u0005\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\n¨\u0006\u000f"}, d2 = {"kotlin/sequences/TakeSequence$iterator$1", "", "iterator", "getIterator", "()Ljava/util/Iterator;", "left", "", "getLeft", "()I", "setLeft", "(I)V", "hasNext", "", "next", "()Ljava/lang/Object;", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class TakeSequence$iterator$1<T> implements Iterator<T>, KMappedMarker {
|
||||
private final Iterator<T> iterator;
|
||||
private int left;
|
||||
|
||||
public final Iterator<T> getIterator() {
|
||||
return this.iterator;
|
||||
}
|
||||
|
||||
public final int getLeft() {
|
||||
return this.left;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
public final void setLeft(int i) {
|
||||
this.left = i;
|
||||
}
|
||||
|
||||
TakeSequence$iterator$1(TakeSequence<T> takeSequence) {
|
||||
int i;
|
||||
Sequence sequence;
|
||||
i = ((TakeSequence) takeSequence).count;
|
||||
this.left = i;
|
||||
sequence = ((TakeSequence) takeSequence).sequence;
|
||||
this.iterator = sequence.iterator();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public T next() {
|
||||
int i = this.left;
|
||||
if (i == 0) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
this.left = i - 1;
|
||||
return this.iterator.next();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
return this.left > 0 && this.iterator.hasNext();
|
||||
}
|
||||
}
|
40
02-Easy5/E5/sources/kotlin/sequences/TakeSequence.java
Normal file
40
02-Easy5/E5/sources/kotlin/sequences/TakeSequence.java
Normal file
@ -0,0 +1,40 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010(\n\u0002\b\u0002\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u00022\b\u0012\u0004\u0012\u0002H\u00010\u0003B\u001b\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0002\u0010\u0007J\u0016\u0010\b\u001a\b\u0012\u0004\u0012\u00028\u00000\u00022\u0006\u0010\t\u001a\u00020\u0006H\u0016J\u000f\u0010\n\u001a\b\u0012\u0004\u0012\u00028\u00000\u000bH\u0096\u0002J\u0016\u0010\f\u001a\b\u0012\u0004\u0012\u00028\u00000\u00022\u0006\u0010\t\u001a\u00020\u0006H\u0016R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\r"}, d2 = {"Lkotlin/sequences/TakeSequence;", "T", "Lkotlin/sequences/Sequence;", "Lkotlin/sequences/DropTakeSequence;", "sequence", "count", "", "(Lkotlin/sequences/Sequence;I)V", "drop", "n", "iterator", "", "take", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class TakeSequence<T> implements Sequence<T>, DropTakeSequence<T> {
|
||||
private final int count;
|
||||
private final Sequence<T> sequence;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public TakeSequence(Sequence<? extends T> sequence, int i) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "sequence");
|
||||
this.sequence = sequence;
|
||||
this.count = i;
|
||||
if (i >= 0) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException(("count must be non-negative, but was " + i + '.').toString());
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.DropTakeSequence
|
||||
public Sequence<T> drop(int n) {
|
||||
int i = this.count;
|
||||
return n >= i ? SequencesKt.emptySequence() : new SubSequence(this.sequence, n, i);
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.DropTakeSequence
|
||||
public Sequence<T> take(int n) {
|
||||
return n >= this.count ? this : new TakeSequence(this.sequence, n);
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<T> iterator() {
|
||||
return new TakeSequence$iterator$1(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000#\n\u0000\n\u0002\u0010(\n\u0002\b\n\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001J\b\u0010\u0011\u001a\u00020\u0012H\u0002J\t\u0010\u0013\u001a\u00020\u0014H\u0096\u0002J\u000e\u0010\u0015\u001a\u00028\u0000H\u0096\u0002¢\u0006\u0002\u0010\u0007R\u0017\u0010\u0002\u001a\b\u0012\u0004\u0012\u00028\u00000\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0003\u0010\u0004R\u001e\u0010\u0005\u001a\u0004\u0018\u00018\u0000X\u0086\u000e¢\u0006\u0010\n\u0002\u0010\n\u001a\u0004\b\u0006\u0010\u0007\"\u0004\b\b\u0010\tR\u001a\u0010\u000b\u001a\u00020\fX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\r\u0010\u000e\"\u0004\b\u000f\u0010\u0010¨\u0006\u0016"}, d2 = {"kotlin/sequences/TakeWhileSequence$iterator$1", "", "iterator", "getIterator", "()Ljava/util/Iterator;", "nextItem", "getNextItem", "()Ljava/lang/Object;", "setNextItem", "(Ljava/lang/Object;)V", "Ljava/lang/Object;", "nextState", "", "getNextState", "()I", "setNextState", "(I)V", "calcNext", "", "hasNext", "", "next", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class TakeWhileSequence$iterator$1<T> implements Iterator<T>, KMappedMarker {
|
||||
private final Iterator<T> iterator;
|
||||
private T nextItem;
|
||||
private int nextState;
|
||||
final /* synthetic */ TakeWhileSequence<T> this$0;
|
||||
|
||||
public final Iterator<T> getIterator() {
|
||||
return this.iterator;
|
||||
}
|
||||
|
||||
public final T getNextItem() {
|
||||
return this.nextItem;
|
||||
}
|
||||
|
||||
public final int getNextState() {
|
||||
return this.nextState;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
public final void setNextItem(T t) {
|
||||
this.nextItem = t;
|
||||
}
|
||||
|
||||
public final void setNextState(int i) {
|
||||
this.nextState = i;
|
||||
}
|
||||
|
||||
TakeWhileSequence$iterator$1(TakeWhileSequence<T> takeWhileSequence) {
|
||||
Sequence sequence;
|
||||
this.this$0 = takeWhileSequence;
|
||||
sequence = ((TakeWhileSequence) takeWhileSequence).sequence;
|
||||
this.iterator = sequence.iterator();
|
||||
this.nextState = -1;
|
||||
}
|
||||
|
||||
private final void calcNext() {
|
||||
Function1 function1;
|
||||
if (this.iterator.hasNext()) {
|
||||
T next = this.iterator.next();
|
||||
function1 = ((TakeWhileSequence) this.this$0).predicate;
|
||||
if (((Boolean) function1.invoke(next)).booleanValue()) {
|
||||
this.nextState = 1;
|
||||
this.nextItem = next;
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.nextState = 0;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public T next() {
|
||||
if (this.nextState == -1) {
|
||||
calcNext();
|
||||
}
|
||||
if (this.nextState == 0) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
T t = this.nextItem;
|
||||
this.nextItem = null;
|
||||
this.nextState = -1;
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
if (this.nextState == -1) {
|
||||
calcNext();
|
||||
}
|
||||
return this.nextState == 1;
|
||||
}
|
||||
}
|
27
02-Easy5/E5/sources/kotlin/sequences/TakeWhileSequence.java
Normal file
27
02-Easy5/E5/sources/kotlin/sequences/TakeWhileSequence.java
Normal file
@ -0,0 +1,27 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010(\n\u0000\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u0002B'\u0012\f\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002\u0012\u0012\u0010\u0004\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00020\u00060\u0005¢\u0006\u0002\u0010\u0007J\u000f\u0010\b\u001a\b\u0012\u0004\u0012\u00028\u00000\tH\u0096\u0002R\u001a\u0010\u0004\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00020\u00060\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\n"}, d2 = {"Lkotlin/sequences/TakeWhileSequence;", "T", "Lkotlin/sequences/Sequence;", "sequence", "predicate", "Lkotlin/Function1;", "", "(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)V", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class TakeWhileSequence<T> implements Sequence<T> {
|
||||
private final Function1<T, Boolean> predicate;
|
||||
private final Sequence<T> sequence;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public TakeWhileSequence(Sequence<? extends T> sequence, Function1<? super T, Boolean> predicate) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "sequence");
|
||||
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
||||
this.sequence = sequence;
|
||||
this.predicate = predicate;
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<T> iterator() {
|
||||
return new TakeWhileSequence$iterator$1(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [R] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u001b\n\u0000\n\u0002\u0010(\n\u0000\n\u0002\u0010\b\n\u0002\b\b\n\u0002\u0010\u000b\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001J\t\u0010\u000b\u001a\u00020\fH\u0096\u0002J\u000e\u0010\r\u001a\u00028\u0000H\u0096\u0002¢\u0006\u0002\u0010\u000eR\u001a\u0010\u0002\u001a\u00020\u0003X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0004\u0010\u0005\"\u0004\b\u0006\u0010\u0007R\u0017\u0010\b\u001a\b\u0012\u0004\u0012\u00028\u00010\u0001¢\u0006\b\n\u0000\u001a\u0004\b\t\u0010\n¨\u0006\u000f"}, d2 = {"kotlin/sequences/TransformingIndexedSequence$iterator$1", "", "index", "", "getIndex", "()I", "setIndex", "(I)V", "iterator", "getIterator", "()Ljava/util/Iterator;", "hasNext", "", "next", "()Ljava/lang/Object;", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class TransformingIndexedSequence$iterator$1<R> implements Iterator<R>, KMappedMarker {
|
||||
private int index;
|
||||
private final Iterator<T> iterator;
|
||||
final /* synthetic */ TransformingIndexedSequence<T, R> this$0;
|
||||
|
||||
public final int getIndex() {
|
||||
return this.index;
|
||||
}
|
||||
|
||||
public final Iterator<T> getIterator() {
|
||||
return this.iterator;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
public final void setIndex(int i) {
|
||||
this.index = i;
|
||||
}
|
||||
|
||||
TransformingIndexedSequence$iterator$1(TransformingIndexedSequence<T, R> transformingIndexedSequence) {
|
||||
Sequence sequence;
|
||||
this.this$0 = transformingIndexedSequence;
|
||||
sequence = ((TransformingIndexedSequence) transformingIndexedSequence).sequence;
|
||||
this.iterator = sequence.iterator();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public R next() {
|
||||
Function2 function2;
|
||||
function2 = ((TransformingIndexedSequence) this.this$0).transformer;
|
||||
int i = this.index;
|
||||
this.index = i + 1;
|
||||
if (i < 0) {
|
||||
CollectionsKt.throwIndexOverflow();
|
||||
}
|
||||
return (R) function2.invoke(Integer.valueOf(i), this.iterator.next());
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
return this.iterator.hasNext();
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010(\n\u0000\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u0001*\u0004\b\u0001\u0010\u00022\b\u0012\u0004\u0012\u0002H\u00020\u0003B-\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0003\u0012\u0018\u0010\u0005\u001a\u0014\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010\u0006¢\u0006\u0002\u0010\bJ\u000f\u0010\t\u001a\b\u0012\u0004\u0012\u00028\u00010\nH\u0096\u0002R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R \u0010\u0005\u001a\u0014\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010\u0006X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000b"}, d2 = {"Lkotlin/sequences/TransformingIndexedSequence;", "T", "R", "Lkotlin/sequences/Sequence;", "sequence", "transformer", "Lkotlin/Function2;", "", "(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function2;)V", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class TransformingIndexedSequence<T, R> implements Sequence<R> {
|
||||
private final Sequence<T> sequence;
|
||||
private final Function2<Integer, T, R> transformer;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public TransformingIndexedSequence(Sequence<? extends T> sequence, Function2<? super Integer, ? super T, ? extends R> transformer) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "sequence");
|
||||
Intrinsics.checkNotNullParameter(transformer, "transformer");
|
||||
this.sequence = sequence;
|
||||
this.transformer = transformer;
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<R> iterator() {
|
||||
return new TransformingIndexedSequence$iterator$1(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [R] */
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000\u0015\n\u0000\n\u0002\u0010(\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001J\t\u0010\u0005\u001a\u00020\u0006H\u0096\u0002J\u000e\u0010\u0007\u001a\u00028\u0000H\u0096\u0002¢\u0006\u0002\u0010\bR\u0017\u0010\u0002\u001a\b\u0012\u0004\u0012\u00028\u00010\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0003\u0010\u0004¨\u0006\t"}, d2 = {"kotlin/sequences/TransformingSequence$iterator$1", "", "iterator", "getIterator", "()Ljava/util/Iterator;", "hasNext", "", "next", "()Ljava/lang/Object;", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class TransformingSequence$iterator$1<R> implements Iterator<R>, KMappedMarker {
|
||||
private final Iterator<T> iterator;
|
||||
final /* synthetic */ TransformingSequence<T, R> this$0;
|
||||
|
||||
public final Iterator<T> getIterator() {
|
||||
return this.iterator;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
TransformingSequence$iterator$1(TransformingSequence<T, R> transformingSequence) {
|
||||
Sequence sequence;
|
||||
this.this$0 = transformingSequence;
|
||||
sequence = ((TransformingSequence) transformingSequence).sequence;
|
||||
this.iterator = sequence.iterator();
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public R next() {
|
||||
Function1 function1;
|
||||
function1 = ((TransformingSequence) this.this$0).transformer;
|
||||
return (R) function1.invoke(this.iterator.next());
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
return this.iterator.hasNext();
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Sequences.kt */
|
||||
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010(\n\u0002\b\u0002\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u0001*\u0004\b\u0001\u0010\u00022\b\u0012\u0004\u0012\u0002H\u00020\u0003B'\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0003\u0012\u0012\u0010\u0005\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010\u0006¢\u0006\u0002\u0010\u0007J3\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\t0\u0003\"\u0004\b\u0002\u0010\t2\u0018\u0010\n\u001a\u0014\u0012\u0004\u0012\u00028\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\t0\u000b0\u0006H\u0000¢\u0006\u0002\b\fJ\u000f\u0010\n\u001a\b\u0012\u0004\u0012\u00028\u00010\u000bH\u0096\u0002R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u001a\u0010\u0005\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010\u0006X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\r"}, d2 = {"Lkotlin/sequences/TransformingSequence;", "T", "R", "Lkotlin/sequences/Sequence;", "sequence", "transformer", "Lkotlin/Function1;", "(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)V", "flatten", "E", "iterator", "", "flatten$kotlin_stdlib", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class TransformingSequence<T, R> implements Sequence<R> {
|
||||
private final Sequence<T> sequence;
|
||||
private final Function1<T, R> transformer;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public TransformingSequence(Sequence<? extends T> sequence, Function1<? super T, ? extends R> transformer) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "sequence");
|
||||
Intrinsics.checkNotNullParameter(transformer, "transformer");
|
||||
this.sequence = sequence;
|
||||
this.transformer = transformer;
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<R> iterator() {
|
||||
return new TransformingSequence$iterator$1(this);
|
||||
}
|
||||
|
||||
public final <E> Sequence<E> flatten$kotlin_stdlib(Function1<? super R, ? extends Iterator<? extends E>> iterator) {
|
||||
Intrinsics.checkNotNullParameter(iterator, "iterator");
|
||||
return new FlatteningSequence(this.sequence, this.transformer, iterator);
|
||||
}
|
||||
}
|
11
02-Easy5/E5/sources/kotlin/sequences/USequencesKt.java
Normal file
11
02-Easy5/E5/sources/kotlin/sequences/USequencesKt.java
Normal file
@ -0,0 +1,11 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: _USequences.kt */
|
||||
@Metadata(d1 = {"kotlin/sequences/USequencesKt___USequencesKt"}, k = 4, mv = {1, 8, 0}, xi = 49)
|
||||
/* loaded from: classes.dex */
|
||||
public final class USequencesKt extends USequencesKt___USequencesKt {
|
||||
private USequencesKt() {
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package kotlin.sequences;
|
||||
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.UByte;
|
||||
import kotlin.UInt;
|
||||
import kotlin.ULong;
|
||||
import kotlin.UShort;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: _USequences.kt */
|
||||
@Metadata(d1 = {"\u0000\"\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\u001c\u0010\u0000\u001a\u00020\u0001*\b\u0012\u0004\u0012\u00020\u00030\u0002H\u0007ø\u0001\u0000¢\u0006\u0004\b\u0004\u0010\u0005\u001a\u001c\u0010\u0000\u001a\u00020\u0001*\b\u0012\u0004\u0012\u00020\u00010\u0002H\u0007ø\u0001\u0000¢\u0006\u0004\b\u0006\u0010\u0005\u001a\u001c\u0010\u0000\u001a\u00020\u0007*\b\u0012\u0004\u0012\u00020\u00070\u0002H\u0007ø\u0001\u0000¢\u0006\u0004\b\b\u0010\t\u001a\u001c\u0010\u0000\u001a\u00020\u0001*\b\u0012\u0004\u0012\u00020\n0\u0002H\u0007ø\u0001\u0000¢\u0006\u0004\b\u000b\u0010\u0005\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\f"}, d2 = {"sum", "Lkotlin/UInt;", "Lkotlin/sequences/Sequence;", "Lkotlin/UByte;", "sumOfUByte", "(Lkotlin/sequences/Sequence;)I", "sumOfUInt", "Lkotlin/ULong;", "sumOfULong", "(Lkotlin/sequences/Sequence;)J", "Lkotlin/UShort;", "sumOfUShort", "kotlin-stdlib"}, k = 5, mv = {1, 8, 0}, xi = 49, xs = "kotlin/sequences/USequencesKt")
|
||||
/* loaded from: classes.dex */
|
||||
class USequencesKt___USequencesKt {
|
||||
public static final int sumOfUInt(Sequence<UInt> sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Iterator<UInt> it = sequence.iterator();
|
||||
int i = 0;
|
||||
while (it.hasNext()) {
|
||||
i = UInt.m384constructorimpl(i + it.next().getData());
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
public static final long sumOfULong(Sequence<ULong> sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Iterator<ULong> it = sequence.iterator();
|
||||
long j = 0;
|
||||
while (it.hasNext()) {
|
||||
j = ULong.m463constructorimpl(j + it.next().getData());
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
public static final int sumOfUByte(Sequence<UByte> sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Iterator<UByte> it = sequence.iterator();
|
||||
int i = 0;
|
||||
while (it.hasNext()) {
|
||||
i = UInt.m384constructorimpl(i + UInt.m384constructorimpl(it.next().getData() & UByte.MAX_VALUE));
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
public static final int sumOfUShort(Sequence<UShort> sequence) {
|
||||
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
||||
Iterator<UShort> it = sequence.iterator();
|
||||
int i = 0;
|
||||
while (it.hasNext()) {
|
||||
i = UInt.m384constructorimpl(i + UInt.m384constructorimpl(it.next().getData() & UShort.MAX_VALUE));
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user