KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > util > IllegalFormatPrecisionException


1 /*
2  * @(#)IllegalFormatPrecisionException.java 1.4 04/06/07
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.util;
9
10 /**
11  * Unchecked exception thrown when the precision is a negative value other than
12  * <tt>-1</tt>, the conversion does not support a precision, or the value is
13  * otherwise unsupported.
14  *
15  * @version 1.4, 06/07/04
16  * @since 1.5
17  */

18 public class IllegalFormatPrecisionException extends IllegalFormatException JavaDoc {
19
20     private static final long serialVersionUID = 18711008L;
21
22     private int p;
23
24     /**
25      * Constructs an instance of this class with the specified precision.
26      *
27      * @param p
28      * The precision
29      */

30     public IllegalFormatPrecisionException(int p) {
31     this.p = p;
32     }
33
34     /**
35      * Returns the precision
36      *
37      * @return The precision
38      */

39     public int getPrecision() {
40     return p;
41     }
42
43     public String JavaDoc getMessage() {
44     return Integer.toString(p);
45     }
46 }
47
Popular Tags