1   /*
2    * %W% %E%
3    *
4    * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
5    * ORACLE 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     %I%, %G%
15   * @since 1.5
16   */
17  public class IllegalFormatWidthException extends IllegalFormatException {
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 getMessage() {
43      return Integer.toString(w);
44      }
45  }
46