From: kpouer Date: Sun, 3 Aug 2003 14:51:10 +0000 (+0000) Subject: Here is the first class from my declarations descriptions : X-Git-Url: http://git.phpeclipse.com Here is the first class from my declarations descriptions : It will contains usage in code of various things, variables first, bug maybe methods and classes after. It is useful for code analysis --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/declarations/VariableUsage.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/declarations/VariableUsage.java new file mode 100644 index 0000000..4a5eaf1 --- /dev/null +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/declarations/VariableUsage.java @@ -0,0 +1,53 @@ +package net.sourceforge.phpdt.internal.compiler.ast.declarations; + +/** + * A variable usage. + * This describe a variable declaration in a php document and his starting offset + * @author Matthieu Casanova + */ +public class VariableUsage { + + /** the variable name. */ + private String name; + + /** where the variable is declared. */ + private int startOffset; + + /** + * create a VariableUsage. + * @param name the name of the variable + * @param startOffset the offset + */ + public VariableUsage(final String name, final int startOffset) { + this.name = name; + this.startOffset = startOffset; + } + + public String toString() { + return name + " " + startOffset; + } + + /** + * Get the name of the variable. + * @return the name if the variable + */ + public String getName() { + return name; + } + + /** + * Get the starting offset. + * @return the starting offset + */ + public int getStartOffset() { + return startOffset; + } + + public boolean equals(final Object object) { + return name.equals(object); + } + + public int hashCode() { + return name.hashCode(); + } +}