Extended the builder with an index file generator for PHP class- and function-names.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / mover / obfuscator / PHPIdentifier.java
index 1f391dd..5c59457 100644 (file)
@@ -3,20 +3,17 @@ package net.sourceforge.phpeclipse.mover.obfuscator;
 /**
  * @author khartlage
  *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
  */
 public class PHPIdentifier {
-  
+
   public final static int CLASS = 1;
   public final static int FUNCTION = 2;
   public final static int VARIABLE = 3;
-  
+       public final static int METHOD = 4;
+
   private int fType;
   private String fIdentifier;
-  
+
   public PHPIdentifier(String identifier, int type) {
     fType = type;
     fIdentifier = identifier;
@@ -25,15 +22,15 @@ public class PHPIdentifier {
   public boolean isClass() {
     return fType == CLASS;
   }
-  
+
   public boolean isFuncton() {
     return fType == FUNCTION;
   }
-  
+
   public boolean isVariable() {
     return fType == VARIABLE;
   }
-  
+
   public void setType(int fType) {
     this.fType = fType;
   }
@@ -49,5 +46,16 @@ public class PHPIdentifier {
   public String getIdentifier() {
     return fIdentifier;
   }
-  
+
+  /* (non-Javadoc)
+   * @see java.lang.Object#equals(java.lang.Object)
+   */
+  public boolean equals(Object obj) {
+    if (!(obj instanceof PHPIdentifier)) {
+      return false;
+    }
+    return ((PHPIdentifier) obj).fType == fType && 
+           ((PHPIdentifier) obj).fIdentifier.equals(fIdentifier);
+  }
+
 }