1 package net.sourceforge.phpdt.internal.compiler.ast.declarations;
5 * This describe a variable declaration in a php document and his starting offset
6 * @author Matthieu Casanova
8 public final class VariableUsage {
10 /** the variable name. */
11 private final String name;
13 /** where the variable is declared. */
14 private final int startOffset;
17 * create a VariableUsage.
18 * @param name the name of the variable
19 * @param startOffset the offset
21 public VariableUsage(final String name, final int startOffset) {
23 this.startOffset = startOffset;
26 public String toString() {
27 return name + ' ' + startOffset;
31 * Get the name of the variable.
32 * @return the name if the variable
34 public String getName() {
39 * Get the starting offset.
40 * @return the starting offset
42 public int getStartOffset() {
46 public boolean equals(final Object object) {
47 return name.equals(object);
50 public int hashCode() {
51 return name.hashCode();