new icons
[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 METHOD = 4;
12   public final static int VARIABLE = 3;
13   public final static int DEFINE = 5;
14   private String fIdentifier;
15
16   private int fType;
17
18   public PHPIdentifier(String identifier, int type) {
19     fType = type;
20     fIdentifier = identifier;
21   }
22
23   /* (non-Javadoc)
24    * @see java.lang.Object#equals(java.lang.Object)
25    */
26   public boolean equals(Object obj) {
27     if (!(obj instanceof PHPIdentifier)) {
28       return false;
29     }
30     return ((PHPIdentifier) obj).fType == fType && ((PHPIdentifier) obj).fIdentifier.equals(fIdentifier);
31   }
32
33   public String getIdentifier() {
34     return fIdentifier;
35   }
36
37   public int getType() {
38     return fType;
39   }
40
41   public boolean isClass() {
42     return fType == CLASS;
43   }
44
45   public boolean isFuncton() {
46     return fType == FUNCTION;
47   }
48
49   public boolean isVariable() {
50     return fType == VARIABLE;
51   }
52
53   public boolean isMethod() {
54     return fType == METHOD;
55   }
56
57   public boolean isDefine() {
58     return fType == DEFINE;
59   }
60
61   public void setIdentifier(String fIdentifier) {
62     this.fIdentifier = fIdentifier;
63   }
64
65   public void setType(int fType) {
66     this.fType = fType;
67   }
68
69   /* (non-Javadoc)
70    * @see java.lang.Object#toString()
71    */
72   public String toString() {
73     switch (fType) {
74       case CLASS :
75         return "class - ";
76       case DEFINE :
77         return "define - ";
78       case FUNCTION :
79         return "function - ";
80       case METHOD :
81         return "method - ";
82       case VARIABLE :
83         return "variable - ";
84     }
85     return "";
86   }
87
88 }