72 lines
1.8 KiB
Java
72 lines
1.8 KiB
Java
package c.i.d.q;
|
|
|
|
import java.io.ObjectStreamException;
|
|
import java.math.BigDecimal;
|
|
/* compiled from: LazilyParsedNumber */
|
|
public final class q extends Number {
|
|
private final String value;
|
|
|
|
public q(String str) {
|
|
this.value = str;
|
|
}
|
|
|
|
private Object writeReplace() throws ObjectStreamException {
|
|
return new BigDecimal(this.value);
|
|
}
|
|
|
|
@Override // java.lang.Number
|
|
public double doubleValue() {
|
|
return Double.parseDouble(this.value);
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof q)) {
|
|
return false;
|
|
}
|
|
String str = this.value;
|
|
String str2 = ((q) obj).value;
|
|
return str == str2 || str.equals(str2);
|
|
}
|
|
|
|
@Override // java.lang.Number
|
|
public float floatValue() {
|
|
return Float.parseFloat(this.value);
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public int hashCode() {
|
|
return this.value.hashCode();
|
|
}
|
|
|
|
@Override // java.lang.Number
|
|
public int intValue() {
|
|
try {
|
|
return Integer.parseInt(this.value);
|
|
} catch (NumberFormatException unused) {
|
|
try {
|
|
return (int) Long.parseLong(this.value);
|
|
} catch (NumberFormatException unused2) {
|
|
return new BigDecimal(this.value).intValue();
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // java.lang.Number
|
|
public long longValue() {
|
|
try {
|
|
return Long.parseLong(this.value);
|
|
} catch (NumberFormatException unused) {
|
|
return new BigDecimal(this.value).longValue();
|
|
}
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public String toString() {
|
|
return this.value;
|
|
}
|
|
}
|