OSDN Git Service

c149e0eabb6e6162d241385429d43c5fa618d975
[pf3gnuchains/gcc-fork.git] / libjava / java / text / FieldPosition.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 FieldPosition
22 {
23   int field;
24   int beginIndex;
25   int endIndex;
26
27   public FieldPosition (int field)
28   {
29     this.field = field;
30   }
31
32   public int getField ()
33   {
34     return field;
35   }
36
37   public int getBeginIndex ()
38   {
39     return beginIndex;
40   }
41
42   public int getEndIndex ()
43   {
44     return endIndex;
45   }
46
47   public void setBeginIndex (int index)
48   {
49     beginIndex = index;
50   }
51
52   public void setEndIndex (int index)
53   {
54     endIndex = index;
55   }
56
57   public boolean equals (Object obj)
58   {
59     if (! (obj instanceof FieldPosition))
60       return false;
61     FieldPosition other = (FieldPosition) obj;
62     return (field == other.field
63             && beginIndex == other.beginIndex && endIndex == other.endIndex);
64   }
65 }