KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > util > IllegalFormatWidthException


1 /*
2  * @(#)IllegalFormatWidthException.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 format width is a negative value other
12  * than <tt>-1</tt> or is otherwise unsupported.
13  *
14  * @version 1.4, 06/07/04
15  * @since 1.5
16  */

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

29     public IllegalFormatWidthException(int w) {
30     this.w = w;
31     }
32
33     /**
34      * Returns the width
35      *
36      * @return The width
37      */

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