From 6f5bad51d85412ccc6207c650bba3b8579e4594d Mon Sep 17 00:00:00 2001 From: kpouer Date: Sun, 3 Aug 2003 14:51:10 +0000 Subject: [PATCH] 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 --- .../compiler/ast/declarations/VariableUsage.java | 53 ++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) create mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/declarations/VariableUsage.java 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(); + } +} -- 1.7.1