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. package java.util;
  8. /**
  9. * Unchecked exception thrown when the format width is a negative value other
  10. * than <tt>-1</tt> or is otherwise unsupported.
  11. *
  12. * @version 1.4, 06/07/04
  13. * @since 1.5
  14. */
  15. public class IllegalFormatWidthException extends IllegalFormatException {
  16. private static final long serialVersionUID = 16660902L;
  17. private int w;
  18. /**
  19. * Constructs an instance of this class with the specified width.
  20. *
  21. * @param w
  22. * The width
  23. */
  24. public IllegalFormatWidthException(int w) {
  25. this.w = w;
  26. }
  27. /**
  28. * Returns the width
  29. *
  30. * @return The width
  31. */
  32. public int getWidth() {
  33. return w;
  34. }
  35. public String getMessage() {
  36. return Integer.toString(w);
  37. }
  38. }