1 package net.sourceforge.phpeclipse.obfuscator;
4 * Object which holds an PHP identifier name (i.e. class, function,
8 public class PHPIdentifier {
10 public final static int CLASS = 1;
12 public final static int FUNCTION = 2;
14 public final static int VARIABLE = 3;
16 public final static int METHOD = 4;
18 public final static int DEFINE = 5;
20 public final static int CONSTRUCTOR = 6;
22 public final static int GLOBAL_VARIABLE = 7;
24 public final static int EXTENDS = 8;
26 public final static int IMPLEMENTS = 9;
28 private String fIdentifier;
32 public PHPIdentifier(String identifier, int type) {
34 fIdentifier = identifier;
40 * @see java.lang.Object#equals(java.lang.Object)
42 public boolean equals(Object obj) {
43 if (!(obj instanceof PHPIdentifier)) {
46 return ((PHPIdentifier) obj).fType == fType
47 && ((PHPIdentifier) obj).fIdentifier.equals(fIdentifier);
50 public String getIdentifier() {
54 public int getType() {
58 public boolean isClass() {
59 return fType == CLASS;
62 public boolean isFunction() {
63 return fType == FUNCTION;
66 public boolean isVariable() {
67 return fType == VARIABLE;
70 public boolean isMethod() {
71 return fType == METHOD;
74 public boolean isDefine() {
75 return fType == DEFINE;
78 public boolean isGlobalVariable() {
79 return fType == GLOBAL_VARIABLE;
82 public boolean isConstructor() {
83 return fType == CONSTRUCTOR;
86 public void setIdentifier(String fIdentifier) {
87 this.fIdentifier = fIdentifier;
90 public void setType(int fType) {
97 * @see java.lang.Object#toString()
99 public String toString() {
104 return "constructor - ";
108 return "function - ";
109 case GLOBAL_VARIABLE:
110 return "global variable - ";
114 return "variable - ";