1 package net.sourceforge.phpeclipse.builder;
3 //import net.sourceforge.phpeclipse.obfuscator.PHPIdentifier;
8 public class PHPIdentifierLocation extends PHPIdentifier implements Comparable {
9 final public static int UNDEFINED_MATCH = 0;
11 final public static int PATTERN_MATCH = 1;
13 final public static int EXACT_MATCH = 2;
17 private String fClassname;
19 private String fFilename;
23 private int fPHPDocLength;
25 private int fPHPDocOffset;
27 private String fUsage;
29 public PHPIdentifierLocation(String identifier, int type, String filename) {
30 this(identifier, type, filename, null);
33 public PHPIdentifierLocation(String identifier, int type, String filename,
35 super(identifier, type);
37 fClassname = classname;
47 * @see java.lang.Object#equals(java.lang.Object)
49 public boolean equals(Object obj) {
50 if (!(obj instanceof PHPIdentifierLocation)) {
53 return super.equals(obj)
54 && fFilename.equals(((PHPIdentifierLocation) obj).fFilename);
60 public String getClassname() {
67 public String getFilename() {
74 public int getOffset() {
81 public int getPHPDocLength() {
88 public int getPHPDocOffset() {
95 public String getUsage() {
102 public void setClassname(String string) {
109 public void setFilename(String string) {
116 public void setOffset(int i) {
123 public void setPHPDocLength(int i) {
130 public void setPHPDocOffset(int i) {
137 public void setUsage(String string) {
144 * @see java.lang.Object#toString()
146 public String toString() {
147 String result = null;
149 case UNDEFINED_MATCH:
153 result = " [pattern include][";
156 result = " [exact include][";
161 return super.toString() + result + fFilename + "]";
167 * @see java.lang.Comparable#compareTo(java.lang.Object)
169 public int compareTo(Object o) {
170 PHPIdentifierLocation i = (PHPIdentifierLocation) o;
171 if (fMatch > i.fMatch) {
173 } else if (fMatch < i.fMatch) {
176 return fFilename.compareTo(i.fFilename);
180 * @return Returns the match.
182 public int getMatch() {
190 public void setMatch(int match) {