Package jadx.gui.utils

Source Code of jadx.gui.utils.Position

package jadx.gui.utils;

import jadx.api.CodePosition;
import jadx.gui.treemodel.JClass;

public class Position {
  private final JClass cls;
  private final int line;

  public Position(CodePosition pos) {
    this.cls = new JClass(pos.getJavaClass());
    this.line = pos.getLine();
  }

  public Position(JClass cls, int line) {
    this.cls = cls;
    this.line = line;
  }

  public JClass getCls() {
    return cls;
  }

  public int getLine() {
    return line;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (!(obj instanceof Position)) {
      return false;
    }
    Position position = (Position) obj;
    return line == position.line && cls.equals(position.cls);
  }

  @Override
  public int hashCode() {
    return 31 * cls.hashCode() + line;
  }

  @Override
  public String toString() {
    return "Position: " + cls + " : " + line;
  }
}
TOP

Related Classes of jadx.gui.utils.Position

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.