134 lines
4.6 KiB
Java
134 lines
4.6 KiB
Java
package o;
|
|
|
|
import java.text.DecimalFormatSymbols;
|
|
import java.util.Arrays;
|
|
import java.util.HashSet;
|
|
import java.util.Locale;
|
|
import java.util.Set;
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
import java.util.concurrent.ConcurrentMap;
|
|
|
|
/* renamed from: o.gtt, reason: case insensitive filesystem */
|
|
/* loaded from: classes6.dex */
|
|
public final class C15559gtt {
|
|
private final char decimalSeparator;
|
|
private final char negativeSign;
|
|
private final char positiveSign;
|
|
private final char zeroDigit;
|
|
public static final C15559gtt STANDARD = new C15559gtt('0', '+', '-', '.');
|
|
private static final ConcurrentMap<Locale, C15559gtt> CACHE = new ConcurrentHashMap(16, 0.75f, 2);
|
|
|
|
public static Set<Locale> getAvailableLocales() {
|
|
return new HashSet(Arrays.asList(DecimalFormatSymbols.getAvailableLocales()));
|
|
}
|
|
|
|
public static C15559gtt ofDefaultLocale() {
|
|
return of(Locale.getDefault());
|
|
}
|
|
|
|
public static C15559gtt of(Locale locale) {
|
|
gtG.requireNonNull(locale, "locale");
|
|
ConcurrentMap<Locale, C15559gtt> concurrentMap = CACHE;
|
|
C15559gtt c15559gtt = concurrentMap.get(locale);
|
|
if (c15559gtt != null) {
|
|
return c15559gtt;
|
|
}
|
|
concurrentMap.putIfAbsent(locale, create(locale));
|
|
return concurrentMap.get(locale);
|
|
}
|
|
|
|
private static C15559gtt create(Locale locale) {
|
|
DecimalFormatSymbols decimalFormatSymbols = DecimalFormatSymbols.getInstance(locale);
|
|
char zeroDigit = decimalFormatSymbols.getZeroDigit();
|
|
char minusSign = decimalFormatSymbols.getMinusSign();
|
|
char decimalSeparator = decimalFormatSymbols.getDecimalSeparator();
|
|
return (zeroDigit == '0' && minusSign == '-' && decimalSeparator == '.') ? STANDARD : new C15559gtt(zeroDigit, '+', minusSign, decimalSeparator);
|
|
}
|
|
|
|
private C15559gtt(char c, char c2, char c3, char c4) {
|
|
this.zeroDigit = c;
|
|
this.positiveSign = c2;
|
|
this.negativeSign = c3;
|
|
this.decimalSeparator = c4;
|
|
}
|
|
|
|
public final C15559gtt withZeroDigit(char c) {
|
|
return c == this.zeroDigit ? this : new C15559gtt(c, this.positiveSign, this.negativeSign, this.decimalSeparator);
|
|
}
|
|
|
|
public final C15559gtt withPositiveSign(char c) {
|
|
return c == this.positiveSign ? this : new C15559gtt(this.zeroDigit, c, this.negativeSign, this.decimalSeparator);
|
|
}
|
|
|
|
public final C15559gtt withNegativeSign(char c) {
|
|
return c == this.negativeSign ? this : new C15559gtt(this.zeroDigit, this.positiveSign, c, this.decimalSeparator);
|
|
}
|
|
|
|
public final C15559gtt withDecimalSeparator(char c) {
|
|
return c == this.decimalSeparator ? this : new C15559gtt(this.zeroDigit, this.positiveSign, this.negativeSign, c);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public final String convertNumberToI18N(String str) {
|
|
char c = this.zeroDigit;
|
|
if (c == '0') {
|
|
return str;
|
|
}
|
|
char[] charArray = str.toCharArray();
|
|
for (int i = 0; i < charArray.length; i++) {
|
|
charArray[i] = (char) (charArray[i] + (c - '0'));
|
|
}
|
|
return new String(charArray);
|
|
}
|
|
|
|
public final boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof C15559gtt)) {
|
|
return false;
|
|
}
|
|
C15559gtt c15559gtt = (C15559gtt) obj;
|
|
return this.zeroDigit == c15559gtt.zeroDigit && this.positiveSign == c15559gtt.positiveSign && this.negativeSign == c15559gtt.negativeSign && this.decimalSeparator == c15559gtt.decimalSeparator;
|
|
}
|
|
|
|
public final String toString() {
|
|
StringBuilder sb = new StringBuilder("DecimalStyle[");
|
|
sb.append(this.zeroDigit);
|
|
sb.append(this.positiveSign);
|
|
sb.append(this.negativeSign);
|
|
sb.append(this.decimalSeparator);
|
|
sb.append("]");
|
|
return sb.toString();
|
|
}
|
|
|
|
public final int hashCode() {
|
|
return this.zeroDigit + this.positiveSign + this.negativeSign + this.decimalSeparator;
|
|
}
|
|
|
|
public final char getZeroDigit() {
|
|
return this.zeroDigit;
|
|
}
|
|
|
|
public final char getPositiveSign() {
|
|
return this.positiveSign;
|
|
}
|
|
|
|
public final char getNegativeSign() {
|
|
return this.negativeSign;
|
|
}
|
|
|
|
public final char getDecimalSeparator() {
|
|
return this.decimalSeparator;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public final int convertToDigit(char c) {
|
|
int i = c - this.zeroDigit;
|
|
if (i < 0 || i > 9) {
|
|
return -1;
|
|
}
|
|
return i;
|
|
}
|
|
}
|