X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/mover/obfuscator/PHPIdentifier.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/mover/obfuscator/PHPIdentifier.java index 5c59457..05820af 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/mover/obfuscator/PHPIdentifier.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/mover/obfuscator/PHPIdentifier.java @@ -8,17 +8,36 @@ public class PHPIdentifier { public final static int CLASS = 1; public final static int FUNCTION = 2; + public final static int METHOD = 4; public final static int VARIABLE = 3; - public final static int METHOD = 4; + public final static int DEFINE = 5; + private String fIdentifier; private int fType; - private String fIdentifier; public PHPIdentifier(String identifier, int type) { fType = type; fIdentifier = identifier; } + /* (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); + } + + public String getIdentifier() { + return fIdentifier; + } + + public int getType() { + return fType; + } + public boolean isClass() { return fType == CLASS; } @@ -31,31 +50,39 @@ public class PHPIdentifier { return fType == VARIABLE; } - public void setType(int fType) { - this.fType = fType; + public boolean isMethod() { + return fType == METHOD; } - public int getType() { - return fType; + public boolean isDefine() { + return fType == DEFINE; } public void setIdentifier(String fIdentifier) { this.fIdentifier = fIdentifier; } - public String getIdentifier() { - return fIdentifier; + public void setType(int fType) { + this.fType = fType; } /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) + * @see java.lang.Object#toString() */ - public boolean equals(Object obj) { - if (!(obj instanceof PHPIdentifier)) { - return false; + public String toString() { + switch (fType) { + case CLASS : + return "class "; + case DEFINE : + return "define "; + case FUNCTION : + return "function "; + case METHOD : + return "method "; + case VARIABLE : + return "variable "; } - return ((PHPIdentifier) obj).fType == fType && - ((PHPIdentifier) obj).fIdentifier.equals(fIdentifier); + return ""; } }