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