/[classpath]/classpath/java/text/ParseException.java
ViewVC logotype

Diff of /classpath/java/text/ParseException.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by mark, Tue Jan 22 22:27:01 2002 UTC revision 1.5 by ericb, Sun Feb 24 04:25:17 2002 UTC
# Line 1  Line 1 
1  /* ParseException.java -- An error occurred while parsing.  /* ParseException.java -- an error occurred while parsing
2     Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.     Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 7  GNU Classpath is free software; you can Line 7  GNU Classpath is free software; you can
7  it under the terms of the GNU General Public License as published by  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)  the Free Software Foundation; either version 2, or (at your option)
9  any later version.  any later version.
10    
11  GNU Classpath is distributed in the hope that it will be useful, but  GNU Classpath is distributed in the hope that it will be useful, but
12  WITHOUT ANY WARRANTY; without even the implied warranty of  WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package java.text;  package java.text;
40    
 /* Written using "Java Class Libraries", 2nd edition, plus online  
  * API docs for JDK 1.2 beta from http://www.javasoft.com.  
  * Status:  Believed complete and correct.  
  */  
   
 /**  
   * This exception is thrown when an unexpected error occurs during parsing.  
   *  
   * @version 0.0  
   *  
   * @author Aaron M. Renn (arenn@urbanophile.com)  
   * @author Per Bothner <bothner@cygnus.com>  
   * @date October 25, 1998.  
   */  
 public class ParseException extends Exception  
 {  
   
 /*  
  * Instance Variables  
  */  
   
41  /**  /**
42    * This is the position where the error was encountered.   * This exception is thrown when an unexpected error occurs during parsing.
43    */   *
44  private int errorOffset;   * @author Aaron M. Renn (arenn@urbanophile.com)
45     * @author Per Bothner <bothner@cygnus.com>
46  /*************************************************************************/   * @see Format
47     * @see FieldPosition
48  /*   * @status updated to 1.4
  * Constructors  
49   */   */
50    public class ParseException extends Exception
 /**  
   * This method initializes a new instance of <code>ParseException</code>  
   * with a detailed error message and a error position.  
   *  
   * @param msg The descriptive message describing the error.  
   * @param offset The position where the error was encountered.  
   */  
 public  
 ParseException(String s, int offset)  
 {  
   super(s);  
     
   errorOffset = offset;  
 }  
   
 /*************************************************************************/  
   
 /**  
   * This method returns the position where the error occurred.  
   *  
   * @return The position where the error occurred.  
   */  
 public int  
 getErrorOffset()  
51  {  {
52    return(errorOffset);    /**
53  }     * Compatible with JDK 1.1+.
54       */
55      private static final long serialVersionUID = 2703218443322787634L;
56    
57      /**
58       * This is the position where the error was encountered.
59       *
60       * @serial the zero-based offset in the string where the error occurred
61       */
62      private final int errorOffset;
63    
64      /**
65       * This method initializes a new instance of <code>ParseException</code>
66       * with a detailed error message and a error position.
67       *
68       * @param msg the descriptive message describing the error
69       * @param offset the position where the error was encountered
70       */
71      public ParseException(String s, int offset)
72      {
73        super(s);
74        errorOffset = offset;
75      }
76    
77      /**
78       * This method returns the position where the error occurred.
79       *
80       * @return the position where the error occurred
81       */
82      public int getErrorOffset()
83      {
84        return errorOffset;
85      }
86  } // class ParseException  } // class ParseException
   

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26