43006a0c0e234df9fddccb1bec4c9a911c69d27f
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / builder / PHPIdentifierLocation.java
1 package net.sourceforge.phpeclipse.builder;
2
3 import net.sourceforge.phpeclipse.mover.obfuscator.PHPIdentifier;
4
5 /**
6  * @author khartlage
7  *
8  */
9 public class PHPIdentifierLocation extends PHPIdentifier {
10   private String fClassname;
11   private String fFilename;
12         private int fOffset;
13         private int fPHPDocLength;
14         private int fPHPDocOffset;
15
16   public PHPIdentifierLocation(String identifier, int type, String filename) {
17     this(identifier, type, filename, null);
18   }
19
20         public PHPIdentifierLocation(String identifier, int type, String filename, String classname) {
21                 super(identifier, type);
22                 fFilename = filename;
23                 fClassname = classname;
24                 fOffset = -1;
25                 fPHPDocLength = -1;
26                 fPHPDocOffset = -1;
27         }
28   /* (non-Javadoc)
29    * @see java.lang.Object#equals(java.lang.Object)
30    */
31   public boolean equals(Object obj) {
32                 if (!(obj instanceof PHPIdentifierLocation)) {
33                         return false;
34                 }
35     return super.equals(obj)&&fFilename.equals(((PHPIdentifierLocation)obj).fFilename);
36   }
37
38   /**
39    * @return
40    */
41   public String getClassname() {
42     return fClassname;
43   }
44
45   /**
46    * @return
47    */
48   public String getFilename() {
49     return fFilename;
50   }
51
52   /**
53    * @return
54    */
55   public int getOffset() {
56     return fOffset;
57   }
58
59   /**
60    * @return
61    */
62   public int getPHPDocLength() {
63     return fPHPDocLength;
64   }
65
66   /**
67    * @return
68    */
69   public int getPHPDocOffset() {
70     return fPHPDocOffset;
71   }
72
73   /**
74    * @param string
75    */
76   public void setClassname(String string) {
77     fClassname = string;
78   }
79
80   /**
81    * @param string
82    */
83   public void setFilename(String string) {
84     fFilename = string;
85   }
86
87   /**
88    * @param i
89    */
90   public void setOffset(int i) {
91     fOffset = i;
92   }
93
94   /**
95    * @param i
96    */
97   public void setPHPDocLength(int i) {
98     fPHPDocLength = i;
99   }
100
101   /**
102    * @param i
103    */
104   public void setPHPDocOffset(int i) {
105     fPHPDocOffset = i;
106   }
107
108   /* (non-Javadoc)
109    * @see java.lang.Object#toString()
110    */
111   public String toString() {
112     return super.toString()+"\n"+fFilename;
113   }
114
115 }