emul/mini/src/main/java/java/lang/NumberFormatException.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Sat, 26 Jan 2013 08:47:05 +0100
changeset 592 5e13b1ac2886
parent 68 a2924470187b
permissions -rw-r--r--
In order to support fields of the same name in subclasses we are now prefixing them with name of the class that defines them. To provide convenient way to access them from generated bytecode and also directly from JavaScript, there is a getter/setter function for each field. It starts with _ followed by the field name. If called with a parameter, it sets the field, with a parameter it just returns it.
jaroslav@68
     1
/*
jaroslav@68
     2
 * Copyright (c) 1994, 2001, Oracle and/or its affiliates. All rights reserved.
jaroslav@68
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jaroslav@68
     4
 *
jaroslav@68
     5
 * This code is free software; you can redistribute it and/or modify it
jaroslav@68
     6
 * under the terms of the GNU General Public License version 2 only, as
jaroslav@68
     7
 * published by the Free Software Foundation.  Oracle designates this
jaroslav@68
     8
 * particular file as subject to the "Classpath" exception as provided
jaroslav@68
     9
 * by Oracle in the LICENSE file that accompanied this code.
jaroslav@68
    10
 *
jaroslav@68
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
jaroslav@68
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jaroslav@68
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
jaroslav@68
    14
 * version 2 for more details (a copy is included in the LICENSE file that
jaroslav@68
    15
 * accompanied this code).
jaroslav@68
    16
 *
jaroslav@68
    17
 * You should have received a copy of the GNU General Public License version
jaroslav@68
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
jaroslav@68
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jaroslav@68
    20
 *
jaroslav@68
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jaroslav@68
    22
 * or visit www.oracle.com if you need additional information or have any
jaroslav@68
    23
 * questions.
jaroslav@68
    24
 */
jaroslav@68
    25
jaroslav@68
    26
package java.lang;
jaroslav@68
    27
jaroslav@68
    28
/**
jaroslav@68
    29
 * Thrown to indicate that the application has attempted to convert
jaroslav@68
    30
 * a string to one of the numeric types, but that the string does not
jaroslav@68
    31
 * have the appropriate format.
jaroslav@68
    32
 *
jaroslav@68
    33
 * @author  unascribed
jaroslav@68
    34
 * @see     java.lang.Integer#toString()
jaroslav@68
    35
 * @since   JDK1.0
jaroslav@68
    36
 */
jaroslav@68
    37
public
jaroslav@68
    38
class NumberFormatException extends IllegalArgumentException {
jaroslav@68
    39
    static final long serialVersionUID = -2848938806368998894L;
jaroslav@68
    40
jaroslav@68
    41
    /**
jaroslav@68
    42
     * Constructs a <code>NumberFormatException</code> with no detail message.
jaroslav@68
    43
     */
jaroslav@68
    44
    public NumberFormatException () {
jaroslav@68
    45
        super();
jaroslav@68
    46
    }
jaroslav@68
    47
jaroslav@68
    48
    /**
jaroslav@68
    49
     * Constructs a <code>NumberFormatException</code> with the
jaroslav@68
    50
     * specified detail message.
jaroslav@68
    51
     *
jaroslav@68
    52
     * @param   s   the detail message.
jaroslav@68
    53
     */
jaroslav@68
    54
    public NumberFormatException (String s) {
jaroslav@68
    55
        super (s);
jaroslav@68
    56
    }
jaroslav@68
    57
jaroslav@68
    58
    /**
jaroslav@68
    59
     * Factory method for making a <code>NumberFormatException</code>
jaroslav@68
    60
     * given the specified input which caused the error.
jaroslav@68
    61
     *
jaroslav@68
    62
     * @param   s   the input causing the error
jaroslav@68
    63
     */
jaroslav@68
    64
    static NumberFormatException forInputString(String s) {
jaroslav@68
    65
        return new NumberFormatException("For input string: \"" + s + "\"");
jaroslav@68
    66
    }
jaroslav@68
    67
}