< prev index next >
src/java.base/share/classes/java/text/NumberFormat.java
Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea
*** 257,271 ****
* {@link NumberFormat#INTEGER_FIELD}, the begin index
* and end index of {@code fieldPosition} will be set
* to 0 and 9, respectively for the output string
* {@code 1,234,567.89}.
* @return the value passed in as <code>toAppendTo</code>
! * @exception IllegalArgumentException if <code>number</code> is
* null or not an instance of <code>Number</code>.
! * @exception NullPointerException if <code>toAppendTo</code> or
* <code>pos</code> is null
! * @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.FieldPosition
*/
@Override
public StringBuffer format(Object number,
--- 257,271 ----
* {@link NumberFormat#INTEGER_FIELD}, the begin index
* and end index of {@code fieldPosition} will be set
* to 0 and 9, respectively for the output string
* {@code 1,234,567.89}.
* @return the value passed in as <code>toAppendTo</code>
! * @throws IllegalArgumentException if <code>number</code> is
* null or not an instance of <code>Number</code>.
! * @throws NullPointerException if <code>toAppendTo</code> or
* <code>pos</code> is null
! * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.FieldPosition
*/
@Override
public StringBuffer format(Object number,
*** 316,326 ****
/**
* Specialization of format.
*
* @param number the double number to format
* @return the formatted String
! * @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
*/
public final String format(double number) {
// Use fast-path for double result if that works
--- 316,326 ----
/**
* Specialization of format.
*
* @param number the double number to format
* @return the formatted String
! * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
*/
public final String format(double number) {
// Use fast-path for double result if that works
*** 341,351 ****
/**
* Specialization of format.
*
* @param number the long number to format
* @return the formatted String
! * @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
*/
public final String format(long number) {
return format(number, new StringBuffer(),
--- 341,351 ----
/**
* Specialization of format.
*
* @param number the long number to format
* @return the formatted String
! * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
*/
public final String format(long number) {
return format(number, new StringBuffer(),
*** 365,375 ****
* {@link NumberFormat#INTEGER_FIELD}, the begin index
* and end index of {@code fieldPosition} will be set
* to 0 and 9, respectively for the output string
* {@code 1,234,567.89}.
* @return the formatted StringBuffer
! * @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
*/
public abstract StringBuffer format(double number,
StringBuffer toAppendTo,
--- 365,375 ----
* {@link NumberFormat#INTEGER_FIELD}, the begin index
* and end index of {@code fieldPosition} will be set
* to 0 and 9, respectively for the output string
* {@code 1,234,567.89}.
* @return the formatted StringBuffer
! * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
*/
public abstract StringBuffer format(double number,
StringBuffer toAppendTo,
*** 388,398 ****
* {@link NumberFormat#INTEGER_FIELD}, the begin index
* and end index of {@code fieldPosition} will be set
* to 0 and 11, respectively for the output string
* {@code 123,456,789}.
* @return the formatted StringBuffer
! * @exception ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
*/
public abstract StringBuffer format(long number,
StringBuffer toAppendTo,
--- 388,398 ----
* {@link NumberFormat#INTEGER_FIELD}, the begin index
* and end index of {@code fieldPosition} will be set
* to 0 and 11, respectively for the output string
* {@code 123,456,789}.
* @return the formatted StringBuffer
! * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.Format#format
*/
public abstract StringBuffer format(long number,
StringBuffer toAppendTo,
*** 422,432 ****
* See the {@link #parse(String, ParsePosition)} method for more information
* on number parsing.
*
* @param source A <code>String</code> whose beginning should be parsed.
* @return A <code>Number</code> parsed from the string.
! * @exception ParseException if the beginning of the specified string
* cannot be parsed.
*/
public Number parse(String source) throws ParseException {
ParsePosition parsePosition = new ParsePosition(0);
Number result = parse(source, parsePosition);
--- 422,432 ----
* See the {@link #parse(String, ParsePosition)} method for more information
* on number parsing.
*
* @param source A <code>String</code> whose beginning should be parsed.
* @return A <code>Number</code> parsed from the string.
! * @throws ParseException if the beginning of the specified string
* cannot be parsed.
*/
public Number parse(String source) throws ParseException {
ParsePosition parsePosition = new ParsePosition(0);
Number result = parse(source, parsePosition);
*** 889,899 ****
* <p>
* The default implementation throws
* <code>UnsupportedOperationException</code>.
*
* @return the currency used by this number format, or <code>null</code>
! * @exception UnsupportedOperationException if the number format class
* doesn't implement currency formatting
* @since 1.4
*/
public Currency getCurrency() {
throw new UnsupportedOperationException();
--- 889,899 ----
* <p>
* The default implementation throws
* <code>UnsupportedOperationException</code>.
*
* @return the currency used by this number format, or <code>null</code>
! * @throws UnsupportedOperationException if the number format class
* doesn't implement currency formatting
* @since 1.4
*/
public Currency getCurrency() {
throw new UnsupportedOperationException();
*** 906,918 ****
* <p>
* The default implementation throws
* <code>UnsupportedOperationException</code>.
*
* @param currency the new currency to be used by this number format
! * @exception UnsupportedOperationException if the number format class
* doesn't implement currency formatting
! * @exception NullPointerException if <code>currency</code> is null
* @since 1.4
*/
public void setCurrency(Currency currency) {
throw new UnsupportedOperationException();
}
--- 906,918 ----
* <p>
* The default implementation throws
* <code>UnsupportedOperationException</code>.
*
* @param currency the new currency to be used by this number format
! * @throws UnsupportedOperationException if the number format class
* doesn't implement currency formatting
! * @throws NullPointerException if <code>currency</code> is null
* @since 1.4
*/
public void setCurrency(Currency currency) {
throw new UnsupportedOperationException();
}
*** 922,932 ****
* The default implementation of this method in NumberFormat
* always throws {@link java.lang.UnsupportedOperationException}.
* Subclasses which handle different rounding modes should override
* this method.
*
! * @exception UnsupportedOperationException The default implementation
* always throws this exception
* @return The <code>RoundingMode</code> used for this NumberFormat.
* @see #setRoundingMode(RoundingMode)
* @since 1.6
*/
--- 922,932 ----
* The default implementation of this method in NumberFormat
* always throws {@link java.lang.UnsupportedOperationException}.
* Subclasses which handle different rounding modes should override
* this method.
*
! * @throws UnsupportedOperationException The default implementation
* always throws this exception
* @return The <code>RoundingMode</code> used for this NumberFormat.
* @see #setRoundingMode(RoundingMode)
* @since 1.6
*/
*** 939,951 ****
* The default implementation of this method in NumberFormat always
* throws {@link java.lang.UnsupportedOperationException}.
* Subclasses which handle different rounding modes should override
* this method.
*
! * @exception UnsupportedOperationException The default implementation
* always throws this exception
! * @exception NullPointerException if <code>roundingMode</code> is null
* @param roundingMode The <code>RoundingMode</code> to be used
* @see #getRoundingMode()
* @since 1.6
*/
public void setRoundingMode(RoundingMode roundingMode) {
--- 939,951 ----
* The default implementation of this method in NumberFormat always
* throws {@link java.lang.UnsupportedOperationException}.
* Subclasses which handle different rounding modes should override
* this method.
*
! * @throws UnsupportedOperationException The default implementation
* always throws this exception
! * @throws NullPointerException if <code>roundingMode</code> is null
* @param roundingMode The <code>RoundingMode</code> to be used
* @see #getRoundingMode()
* @since 1.6
*/
public void setRoundingMode(RoundingMode roundingMode) {
< prev index next >