5c59457009b9ee5b0e70df7a6b449a4c30544b7f
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / mover / obfuscator / PHPIdentifier.java
1 package net.sourceforge.phpeclipse.mover.obfuscator;
2
3 /**
4  * @author khartlage
5  *
6  */
7 public class PHPIdentifier {
8
9   public final static int CLASS = 1;
10   public final static int FUNCTION = 2;
11   public final static int VARIABLE = 3;
12         public final static int METHOD = 4;
13
14   private int fType;
15   private String fIdentifier;
16
17   public PHPIdentifier(String identifier, int type) {
18     fType = type;
19     fIdentifier = identifier;
20   }
21
22   public boolean isClass() {
23     return fType == CLASS;
24   }
25
26   public boolean isFuncton() {
27     return fType == FUNCTION;
28   }
29
30   public boolean isVariable() {
31     return fType == VARIABLE;
32   }
33
34   public void setType(int fType) {
35     this.fType = fType;
36   }
37
38   public int getType() {
39     return fType;
40   }
41
42   public void setIdentifier(String fIdentifier) {
43     this.fIdentifier = fIdentifier;
44   }
45
46   public String getIdentifier() {
47     return fIdentifier;
48   }
49
50   /* (non-Javadoc)
51    * @see java.lang.Object#equals(java.lang.Object)
52    */
53   public boolean equals(Object obj) {
54     if (!(obj instanceof PHPIdentifier)) {
55       return false;
56     }
57     return ((PHPIdentifier) obj).fType == fType && 
58            ((PHPIdentifier) obj).fIdentifier.equals(fIdentifier);
59   }
60
61 }