public class LabeledPoint {
  private int x;
  private int y;
  private String label;
  
  public LabeledPoint() {
    x = 0;
    y = 0;
    label = "";
  }

  public LabeledPoint(String L, int initialX, int initialY) {
    x = initialX;
    y = initialY;
    label = L;
  }

  public void move(int dx, int dy) {
    x += dx;
    y += dy;
  }

  public void setX(int newX) {
    x = newX;
  }

  public void setY(int newY) {
    y = newY;
  }

  public void setLabel(String newLabel) {
    label = newLabel;
  }
  
  public int getX() {
    return x;
  }
    
  public int getY() {
    return y;
  }

  public String getLabel() {
    return label;
  }
    
  public String toString() {
    return "(" + label + ": " + x + "," + y + ")";
  }

  public boolean equals(LabeledPoint otherPoint) {
    return x == otherPoint.x &&
        y == otherPoint.y &&
        label.equals(otherPoint.label); /* remember that
                                         * == would just
                                         * compare String
                                         * location */
  }

  public LabeledPoint clone() {
    return new LabeledPoint(label, x, y);
  }
}
