home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / text / ParseException.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  2.4 KB  |  73 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)ParseException.java    1.12 98/10/02
  3.  *
  4.  * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved
  5.  * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved
  6.  *
  7.  * Portions copyright (c) 1996-1998 Sun Microsystems, Inc.
  8.  * All Rights Reserved.
  9.  *
  10.  *   The original version of this source code and documentation is copyrighted
  11.  * and owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These
  12.  * materials are provided under terms of a License Agreement between Taligent
  13.  * and Sun. This technology is protected by multiple US and International
  14.  * patents. This notice and attribution to Taligent may not be removed.
  15.  *   Taligent is a registered trademark of Taligent, Inc.
  16.  *
  17.  * Permission to use, copy, modify, and distribute this software
  18.  * and its documentation for NON-COMMERCIAL purposes and without
  19.  * fee is hereby granted provided that this copyright notice
  20.  * appears in all copies. Please refer to the file "copyright.html"
  21.  * for further important copyright and licensing information.
  22.  *
  23.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  24.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  25.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  26.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  27.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  28.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  29.  *
  30.  */
  31.  
  32. package java.text;
  33.  
  34. /**
  35.  * Signals that an error has been reached unexpectedly
  36.  * while parsing.
  37.  * @see java.lang.Exception
  38.  * @see java.text.Format
  39.  * @see java.text.FieldPosition
  40.  * @version     1.12, 10/02/98
  41.  * @author      Mark Davis
  42.  */
  43. public
  44. class ParseException extends Exception {
  45.  
  46.     /**
  47.      * Constructs a ParseException with the specified detail message and
  48.      * offset.
  49.      * A detail message is a String that describes this particular exception.
  50.      * @param s the detail message
  51.      * @param errorOffset the position where the error is found while parsing.
  52.      */
  53.     public ParseException(String s, int errorOffset) {
  54.         super(s);
  55.         this.errorOffset = errorOffset;
  56.     }
  57.  
  58.     /**
  59.      * Returns the position where the error was found.
  60.      */
  61.     public int getErrorOffset () {
  62.         return errorOffset;
  63.     }
  64.  
  65.     //============ privates ============
  66.     /**
  67.      * The zero-based character offset into the string being parsed at which
  68.      * the error was found during parsing.
  69.      * @serial
  70.      */
  71.     private int errorOffset;
  72. }
  73.