summaryrefslogtreecommitdiff
path: root/plugins/structuralsearch/source/com/intellij/tokenindex/PathMarkerToken.java
blob: f74590f46bb1d9f06aa0a6c0406a28af4c33a44a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.intellij.tokenindex;

import org.jetbrains.annotations.NotNull;

/**
 * @author Eugene.Kudelevsky
 */
public class PathMarkerToken extends Token {
  private final String myPath;

  public PathMarkerToken(@NotNull String path) {
    super(-1, -1);
    myPath = path;
  }

  public String getPath() {
    return myPath;
  }

  @Override
  public String toString() {
    return myPath;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    PathMarkerToken that = (PathMarkerToken)o;

    if (!myPath.equals(that.myPath)) return false;

    return true;
  }

  @Override
  public int hashCode() {
    return myPath.hashCode();
  }
}