1. /*
  2. * @(#)BadLocationException.java 1.16 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.swing.text;
  11. /**
  12. * This exception is to report bad locations within a document model
  13. * (that is, attempts to reference a location that doesn't exist).
  14. * <p>
  15. * <strong>Warning:</strong>
  16. * Serialized objects of this class will not be compatible with
  17. * future Swing releases. The current serialization support is appropriate
  18. * for short term storage or RMI between applications running the same
  19. * version of Swing. A future release of Swing will provide support for
  20. * long term persistence.
  21. *
  22. * @author Timothy Prinzing
  23. * @version 1.16 02/02/00
  24. */
  25. public class BadLocationException extends Exception
  26. {
  27. /**
  28. * Creates a new BadLocationException object.
  29. *
  30. * @param s a string indicating what was wrong with the arguments
  31. * @param offs offset within the document that was requested >= 0
  32. */
  33. public BadLocationException(String s, int offs) {
  34. super(s);
  35. this.offs = offs;
  36. }
  37. /**
  38. * Returns the offset into the document that was not legal.
  39. *
  40. * @return the offset >= 0
  41. */
  42. public int offsetRequested() {
  43. return offs;
  44. }
  45. private int offs;
  46. }