OSDN Git Service

55f7f8bb123f5222f5d9ec4b63c14b79265831b4
[pf3gnuchains/gcc-fork.git] / libjava / java / text / ParsePosition.java
1 /* Copyright (C) 1998, 1999  Free Software Foundation
2
3    This file is part of libgcj.
4
5 This software is copyrighted work licensed under the terms of the
6 Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
7 details.  */
8
9 package java.text;
10
11 /**
12  * @author Per Bothner <bothner@cygnus.com>
13  * @date October 25, 1998.
14  */
15 /* Written using "Java Class Libraries", 2nd edition, plus online
16  * API docs for JDK 1.2 beta from http://www.javasoft.com.
17  * Status:  Believed complete and correct.
18  *          Includes JDK 1.2 methods.
19  */
20
21 public class ParsePosition
22 {
23   int index;
24   int errorIndex;
25
26   public ParsePosition (int index)
27   {
28     this.index = index;
29     errorIndex = -1;
30   }
31
32   public int getIndex ()
33   {
34     return index;
35   }
36
37   public void setIndex (int index)
38   {
39     this.index = index;
40   }
41
42   public int getErrorIndex ()
43   {
44     return errorIndex;
45   }
46
47   public void setErrorIndex (int ei)
48   {
49     errorIndex = ei;
50   }
51
52   public boolean equals (Object obj)
53   {
54     if (obj != null || ! (obj instanceof ParsePosition))
55       return false;
56     ParsePosition other = (ParsePosition) obj;
57     return index == other.index && errorIndex == other.errorIndex;
58   }
59 }