From bde27a6d881632e103e6dc69589dd208dde92f02 Mon Sep 17 00:00:00 2001 From: John Fitzpatrick Date: Wed, 5 Apr 2000 17:40:54 +0000 Subject: [PATCH] Restored com.ibm.math.BigDecimal support X-SVN-Rev: 1069 --- icu4j/src/com/ibm/icu/text/DigitList.java | 8 +++----- icu4j/src/com/ibm/icu/text/NumberFormat.java | 21 ++++++++++---------- icu4j/src/com/ibm/text/DigitList.java | 8 +++----- icu4j/src/com/ibm/text/NumberFormat.java | 21 ++++++++++---------- 4 files changed, 26 insertions(+), 32 deletions(-) diff --git a/icu4j/src/com/ibm/icu/text/DigitList.java b/icu4j/src/com/ibm/icu/text/DigitList.java index 472543eb389..5cd5c4fc657 100755 --- a/icu4j/src/com/ibm/icu/text/DigitList.java +++ b/icu4j/src/com/ibm/icu/text/DigitList.java @@ -5,8 +5,8 @@ ******************************************************************************* * * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/text/DigitList.java,v $ - * $Date: 2000/03/10 04:07:20 $ - * $Revision: 1.3 $ + * $Date: 2000/04/05 17:40:54 $ + * $Revision: 1.4 $ * ***************************************************************************************** */ @@ -592,7 +592,6 @@ final class DigitList implements Cloneable { setBigDecimalDigits(source.toString(), maximumDigits, fixedPoint); } - //This has been removed pending addition of com.ibm.math package to ICU4J /* * Set the digit list to a representation of the given BigDecimal value. * [bnf] @@ -602,12 +601,11 @@ final class DigitList implements Cloneable { * in source, the representation will be rounded. Ignored if <= 0. * @param fixedPoint If true, then maximumDigits is the maximum * fractional digits to be converted. If false, total digits. - * + */ public final void set(com.ibm.math.BigDecimal source, int maximumDigits, boolean fixedPoint) { setBigDecimalDigits(source.toString(), maximumDigits, fixedPoint); } - */ /** * equality test between two digit lists. diff --git a/icu4j/src/com/ibm/icu/text/NumberFormat.java b/icu4j/src/com/ibm/icu/text/NumberFormat.java index 03c16158c20..16802631829 100755 --- a/icu4j/src/com/ibm/icu/text/NumberFormat.java +++ b/icu4j/src/com/ibm/icu/text/NumberFormat.java @@ -5,8 +5,8 @@ ******************************************************************************* * * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/text/NumberFormat.java,v $ - * $Date: 2000/03/10 04:07:22 $ - * $Revision: 1.5 $ + * $Date: 2000/04/05 17:40:54 $ + * $Revision: 1.6 $ * ***************************************************************************************** */ @@ -141,7 +141,7 @@ import java.io.ObjectOutputStream; * * see java.text.DecimalFormat * see java.text.ChoiceFormat - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * @author Mark Davis * @author Helena Shih * @author Alan Liu @@ -177,10 +177,9 @@ public abstract class NumberFormat extends Format{ return format((BigInteger) number, toAppendTo, pos); } else if (number instanceof java.math.BigDecimal) { return format((java.math.BigDecimal) number, toAppendTo, pos); -// This has been removed pending addition of com.ibm.math package to ICU4J -/* } else if (number instanceof com.ibm.math.BigDecimal) { + } else if (number instanceof com.ibm.math.BigDecimal) { return format((com.ibm.math.BigDecimal) number, toAppendTo, pos); -*/ } else if (number instanceof Number) { + } else if (number instanceof Number) { return format(((Number)number).doubleValue(), toAppendTo, pos); } else { throw new IllegalArgumentException("Cannot format given Object as a Number"); @@ -232,11 +231,11 @@ public abstract class NumberFormat extends Format{ /* this has been removed pending addition of com.ibm.math packge to ICU4J * NEW * Convenience method to format a BigDecimal. - * + */ public final String format(com.ibm.math.BigDecimal number) { return format(number, new StringBuffer(), new FieldPosition(0)).toString(); - } */ + } /** * Specialization of format. @@ -270,13 +269,13 @@ public abstract class NumberFormat extends Format{ StringBuffer toAppendTo, FieldPosition pos); - /* This has been removed pending addition of com.ibm.math package to ICU4J + /** * NEW * Format a BigDecimal. - * + */ public abstract StringBuffer format(com.ibm.math.BigDecimal number, StringBuffer toAppendTo, - FieldPosition pos); */ + FieldPosition pos); /** * Returns a Long if possible (e.g., within the range [Long.MIN_VALUE, diff --git a/icu4j/src/com/ibm/text/DigitList.java b/icu4j/src/com/ibm/text/DigitList.java index f1b0ffc7eb8..273bec5faa7 100755 --- a/icu4j/src/com/ibm/text/DigitList.java +++ b/icu4j/src/com/ibm/text/DigitList.java @@ -5,8 +5,8 @@ ******************************************************************************* * * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/DigitList.java,v $ - * $Date: 2000/03/10 04:07:20 $ - * $Revision: 1.3 $ + * $Date: 2000/04/05 17:40:54 $ + * $Revision: 1.4 $ * ***************************************************************************************** */ @@ -592,7 +592,6 @@ final class DigitList implements Cloneable { setBigDecimalDigits(source.toString(), maximumDigits, fixedPoint); } - //This has been removed pending addition of com.ibm.math package to ICU4J /* * Set the digit list to a representation of the given BigDecimal value. * [bnf] @@ -602,12 +601,11 @@ final class DigitList implements Cloneable { * in source, the representation will be rounded. Ignored if <= 0. * @param fixedPoint If true, then maximumDigits is the maximum * fractional digits to be converted. If false, total digits. - * + */ public final void set(com.ibm.math.BigDecimal source, int maximumDigits, boolean fixedPoint) { setBigDecimalDigits(source.toString(), maximumDigits, fixedPoint); } - */ /** * equality test between two digit lists. diff --git a/icu4j/src/com/ibm/text/NumberFormat.java b/icu4j/src/com/ibm/text/NumberFormat.java index 64a1560f6cf..6fcb57758b6 100755 --- a/icu4j/src/com/ibm/text/NumberFormat.java +++ b/icu4j/src/com/ibm/text/NumberFormat.java @@ -5,8 +5,8 @@ ******************************************************************************* * * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/NumberFormat.java,v $ - * $Date: 2000/03/10 04:07:22 $ - * $Revision: 1.5 $ + * $Date: 2000/04/05 17:40:54 $ + * $Revision: 1.6 $ * ***************************************************************************************** */ @@ -141,7 +141,7 @@ import java.io.ObjectOutputStream; * * see java.text.DecimalFormat * see java.text.ChoiceFormat - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * @author Mark Davis * @author Helena Shih * @author Alan Liu @@ -177,10 +177,9 @@ public abstract class NumberFormat extends Format{ return format((BigInteger) number, toAppendTo, pos); } else if (number instanceof java.math.BigDecimal) { return format((java.math.BigDecimal) number, toAppendTo, pos); -// This has been removed pending addition of com.ibm.math package to ICU4J -/* } else if (number instanceof com.ibm.math.BigDecimal) { + } else if (number instanceof com.ibm.math.BigDecimal) { return format((com.ibm.math.BigDecimal) number, toAppendTo, pos); -*/ } else if (number instanceof Number) { + } else if (number instanceof Number) { return format(((Number)number).doubleValue(), toAppendTo, pos); } else { throw new IllegalArgumentException("Cannot format given Object as a Number"); @@ -232,11 +231,11 @@ public abstract class NumberFormat extends Format{ /* this has been removed pending addition of com.ibm.math packge to ICU4J * NEW * Convenience method to format a BigDecimal. - * + */ public final String format(com.ibm.math.BigDecimal number) { return format(number, new StringBuffer(), new FieldPosition(0)).toString(); - } */ + } /** * Specialization of format. @@ -270,13 +269,13 @@ public abstract class NumberFormat extends Format{ StringBuffer toAppendTo, FieldPosition pos); - /* This has been removed pending addition of com.ibm.math package to ICU4J + /** * NEW * Format a BigDecimal. - * + */ public abstract StringBuffer format(com.ibm.math.BigDecimal number, StringBuffer toAppendTo, - FieldPosition pos); */ + FieldPosition pos); /** * Returns a Long if possible (e.g., within the range [Long.MIN_VALUE,