diff options
Diffstat (limited to 'android_icu4j/src/main/java/android/icu/number/ScientificNotation.java')
-rw-r--r-- | android_icu4j/src/main/java/android/icu/number/ScientificNotation.java | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/android_icu4j/src/main/java/android/icu/number/ScientificNotation.java b/android_icu4j/src/main/java/android/icu/number/ScientificNotation.java index a144a79d6..d5637afe3 100644 --- a/android_icu4j/src/main/java/android/icu/number/ScientificNotation.java +++ b/android_icu4j/src/main/java/android/icu/number/ScientificNotation.java @@ -27,7 +27,7 @@ import android.icu.text.NumberFormat; * * @see NumberFormatter */ -public class ScientificNotation extends Notation implements Cloneable { +public class ScientificNotation extends Notation { int engineeringInterval; boolean requireMinInt; @@ -60,7 +60,7 @@ public class ScientificNotation extends Notation implements Cloneable { */ public ScientificNotation withMinExponentDigits(int minExponentDigits) { if (minExponentDigits >= 1 && minExponentDigits <= RoundingUtils.MAX_INT_FRAC_SIG) { - ScientificNotation other = (ScientificNotation) this.clone(); + ScientificNotation other = createCopy(); other.minExponentDigits = minExponentDigits; return other; } else { @@ -84,22 +84,19 @@ public class ScientificNotation extends Notation implements Cloneable { * @see NumberFormatter */ public ScientificNotation withExponentSignDisplay(SignDisplay exponentSignDisplay) { - ScientificNotation other = (ScientificNotation) this.clone(); + ScientificNotation other = createCopy(); other.exponentSignDisplay = exponentSignDisplay; return other; } - /** - * @hide draft / provisional / internal are hidden on Android - */ - @Override - public Object clone() { - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - // Should not happen since parent is Object - throw new AssertionError(e); - } + /** Package-private clone method */ + ScientificNotation createCopy() { + return new ScientificNotation( + engineeringInterval, + requireMinInt, + minExponentDigits, + exponentSignDisplay + ); } /* package-private */ MicroPropsGenerator withLocaleData( |