jimu-decompiled/sources/com/google/zxing/pdf417/decoder/DetectionResultColumn.java
2025-05-13 19:24:51 +02:00

86 lines
2.2 KiB
Java

package com.google.zxing.pdf417.decoder;
import java.util.Formatter;
/* loaded from: classes.dex */
class DetectionResultColumn {
private final BoundingBox a;
private final Codeword[] b;
DetectionResultColumn(BoundingBox boundingBox) {
this.a = new BoundingBox(boundingBox);
this.b = new Codeword[(boundingBox.d() - boundingBox.f()) + 1];
}
final void a(int i, Codeword codeword) {
this.b[c(i)] = codeword;
}
final Codeword b(int i) {
Codeword codeword;
Codeword codeword2;
Codeword a = a(i);
if (a != null) {
return a;
}
for (int i2 = 1; i2 < 5; i2++) {
int c = c(i) - i2;
if (c >= 0 && (codeword2 = this.b[c]) != null) {
return codeword2;
}
int c2 = c(i) + i2;
Codeword[] codewordArr = this.b;
if (c2 < codewordArr.length && (codeword = codewordArr[c2]) != null) {
return codeword;
}
}
return null;
}
final int c(int i) {
return i - this.a.f();
}
public String toString() {
Formatter formatter = new Formatter();
try {
int i = 0;
for (Codeword codeword : this.b) {
if (codeword == null) {
formatter.format("%3d: | %n", Integer.valueOf(i));
i++;
} else {
formatter.format("%3d: %3d|%3d%n", Integer.valueOf(i), Integer.valueOf(codeword.c()), Integer.valueOf(codeword.e()));
i++;
}
}
String formatter2 = formatter.toString();
formatter.close();
return formatter2;
} catch (Throwable th) {
try {
throw th;
} catch (Throwable th2) {
try {
formatter.close();
} catch (Throwable th3) {
th.addSuppressed(th3);
}
throw th2;
}
}
}
final Codeword a(int i) {
return this.b[c(i)];
}
final BoundingBox a() {
return this.a;
}
final Codeword[] b() {
return this.b;
}
}