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