discord-jadx/app/src/main/java/d0/g0/g.java

202 lines
6.1 KiB
Java

package d0.g0;
import d0.f0.q;
import d0.t.c;
import d0.t.n;
import d0.t.u;
import d0.z.d.m;
import d0.z.d.o;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import kotlin.jvm.functions.Function1;
import kotlin.ranges.IntRange;
import kotlin.text.MatchResult;
/* compiled from: Regex.kt */
public final class g implements MatchResult {
public final f a = new b(this);
public List<String> b;
/* renamed from: c reason: collision with root package name */
public final Matcher f2701c;
public final CharSequence d;
/* compiled from: Regex.kt */
public static final class a extends c<String> {
public final /* synthetic */ g j;
public a(g gVar) {
this.j = gVar;
}
@Override // d0.t.a, java.util.Collection, java.util.List
public final /* bridge */ boolean contains(Object obj) {
if (obj instanceof String) {
return contains((String) obj);
}
return false;
}
public /* bridge */ boolean contains(String str) {
return super.contains((Object) str);
}
@Override // d0.t.c, java.util.List
public String get(int i) {
String group = g.access$getMatchResult$p(this.j).group(i);
return group != null ? group : "";
}
@Override // d0.t.a
public int getSize() {
return g.access$getMatchResult$p(this.j).groupCount() + 1;
}
@Override // d0.t.c, java.util.List
public final /* bridge */ int indexOf(Object obj) {
if (obj instanceof String) {
return indexOf((String) obj);
}
return -1;
}
public /* bridge */ int indexOf(String str) {
return super.indexOf((Object) str);
}
@Override // d0.t.c, java.util.List
public final /* bridge */ int lastIndexOf(Object obj) {
if (obj instanceof String) {
return lastIndexOf((String) obj);
}
return -1;
}
public /* bridge */ int lastIndexOf(String str) {
return super.lastIndexOf((Object) str);
}
}
/* compiled from: Regex.kt */
public static final class b extends d0.t.a<e> implements f {
public final /* synthetic */ g i;
/* compiled from: Regex.kt */
public static final class a extends o implements Function1<Integer, e> {
public final /* synthetic */ b this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public a(b bVar) {
super(1);
this.this$0 = bVar;
}
public final e invoke(int i) {
return this.this$0.get(i);
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ e invoke(Integer num) {
return invoke(num.intValue());
}
}
public b(g gVar) {
this.i = gVar;
}
public /* bridge */ boolean contains(e eVar) {
return super.contains((Object) eVar);
}
@Override // d0.t.a, java.util.Collection, java.util.List
public final /* bridge */ boolean contains(Object obj) {
if (obj != null ? obj instanceof e : true) {
return contains((e) obj);
}
return false;
}
public e get(int i) {
IntRange access$range = h.access$range(g.access$getMatchResult$p(this.i), i);
if (access$range.getStart().intValue() < 0) {
return null;
}
String group = g.access$getMatchResult$p(this.i).group(i);
m.checkNotNullExpressionValue(group, "matchResult.group(index)");
return new e(group, access$range);
}
@Override // d0.t.a
public int getSize() {
return g.access$getMatchResult$p(this.i).groupCount() + 1;
}
@Override // d0.t.a, java.util.Collection
public boolean isEmpty() {
return false;
}
@Override // java.util.Collection, java.lang.Iterable
public Iterator<e> iterator() {
return q.map(u.asSequence(n.getIndices(this)), new a(this)).iterator();
}
}
public g(Matcher matcher, CharSequence charSequence) {
m.checkNotNullParameter(matcher, "matcher");
m.checkNotNullParameter(charSequence, "input");
this.f2701c = matcher;
this.d = charSequence;
}
public static final java.util.regex.MatchResult access$getMatchResult$p(g gVar) {
return gVar.f2701c;
}
@Override // kotlin.text.MatchResult
public MatchResult.b getDestructured() {
return MatchResult.a.getDestructured(this);
}
@Override // kotlin.text.MatchResult
public List<String> getGroupValues() {
if (this.b == null) {
this.b = new a(this);
}
List<String> list = this.b;
m.checkNotNull(list);
return list;
}
@Override // kotlin.text.MatchResult
public f getGroups() {
return this.a;
}
@Override // kotlin.text.MatchResult
public IntRange getRange() {
return h.access$range(this.f2701c);
}
@Override // kotlin.text.MatchResult
public String getValue() {
String group = this.f2701c.group();
m.checkNotNullExpressionValue(group, "matchResult.group()");
return group;
}
@Override // kotlin.text.MatchResult
public MatchResult next() {
int end = this.f2701c.end() + (this.f2701c.end() == this.f2701c.start() ? 1 : 0);
if (end > this.d.length()) {
return null;
}
Matcher matcher = this.f2701c.pattern().matcher(this.d);
m.checkNotNullExpressionValue(matcher, "matcher.pattern().matcher(input)");
return h.access$findNext(matcher, end, this.d);
}
}