package net.sf.jasperreports.engine;

public class JRPrintAnchorIndex {
  private int pageIndex = 0;
  
  private JRPrintElement element = null;
  
  private final int offsetX;
  
  private final int offsetY;
  
  public JRPrintAnchorIndex(int page, JRPrintElement elem) {
    this(page, elem, 0, 0);
  }
  
  public JRPrintAnchorIndex(int page, JRPrintElement elem, int offsetX, int offsetY) {
    this.pageIndex = page;
    this.element = elem;
    this.offsetX = offsetX;
    this.offsetY = offsetY;
  }
  
  public int getPageIndex() {
    return this.pageIndex;
  }
  
  public JRPrintElement getElement() {
    return this.element;
  }
  
  public int getElementAbsoluteX() {
    return this.element.getX() + this.offsetX;
  }
  
  public int getElementAbsoluteY() {
    return this.element.getY() + this.offsetY;
  }
}
