package jetbrains.mps.debug.api.source;

/*Generated by MPS */

import jetbrains.mps.annotations.GeneratedClass;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
import java.util.Objects;

@GeneratedClass(node = "r:7e184eff-8349-496f-875b-1e3646bb06f3(jetbrains.mps.debug.api.source)/4701043456212926071", model = "r:7e184eff-8349-496f-875b-1e3646bb06f3(jetbrains.mps.debug.api.source)")
public class TextSourcePosition extends SourcePosition {
  private final VirtualFile myFile;
  private final int myLine;
  public TextSourcePosition(@NotNull VirtualFile file, int line) {
    myFile = file;
    myLine = line;
  }
  public VirtualFile getFile() {
    return myFile;
  }
  public int getLineNumber() {
    return myLine;
  }
  @Override
  public int hashCode() {
    return myFile.hashCode() + 19 * myLine;
  }
  @Override
  public boolean equals(Object object) {
    if (object == null || !(object instanceof TextSourcePosition)) {
      return false;
    }

    TextSourcePosition position = ((TextSourcePosition) object);

    return Objects.equals(myFile, position.myFile) && Objects.equals(myLine, position.myLine);
  }
}
