package ee.ut.ga.model;

import java.math.BigDecimal;

/**
 * Keeps coordinates: x and y. 
 * @author Anton Stalnuhhin
 */
public class Coordinate {
  private BigDecimal x;
  private BigDecimal y;

  public Coordinate(double x, double y) {
    setX(x);
    setY(y);
  }
  
  public Coordinate(BigDecimal x, BigDecimal y) {
    setX(x);
    setY(y);
  }
  
  public BigDecimal getX() {
    return x;
  }

  public void setX(BigDecimal x) {
    this.x = x;
  }

  public BigDecimal getY() {
    return y;
  }

  public void setY(BigDecimal y) {
    this.y = y;
  }
  
  public void setX(double x) {
    setX(new BigDecimal(x));
  }
  
  public void setY(double y) {
    setY(new BigDecimal(y));
  }
  
  public String toString() {
    return "x is " + x + ", y is " + y;
  }
}
