Here is the first class from my declarations descriptions :
authorkpouer <kpouer>
Sun, 3 Aug 2003 14:51:10 +0000 (14:51 +0000)
committerkpouer <kpouer>
Sun, 3 Aug 2003 14:51:10 +0000 (14:51 +0000)
It will contains usage in code of various things, variables first, bug maybe methods and classes after. It is useful for code analysis

net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/declarations/VariableUsage.java [new file with mode: 0644]

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 (file)
index 0000000..4a5eaf1
--- /dev/null
@@ -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();
+  }
+}