/*
 * Copyright 2011 JBoss Inc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.drools.guvnor.client.decisiontable.widget;

/**
 * A coordinate
 * 
 * @author manstis
 * 
 */
public class Coordinate {
	private int row;
	private int col;
	private String displayString;

	Coordinate(Coordinate c) {
		this.row = c.row;
		this.col = c.col;
		this.displayString = "(R" + c.row + ",C" + c.col + ")";
	}

	Coordinate(int row, int col) {
		this.row = row;
		this.col = col;
		this.displayString = "(R" + row + ",C" + col + ")";
	}

	public int getCol() {
		return this.col;
	}

	public int getRow() {
		return this.row;
	}

	@Override
	public boolean equals(Object o) {
		if (o == null) {
			return false;
		}
		Coordinate c = (Coordinate) o;
		return c.col == col && c.row == row;
	}

	@Override
	public int hashCode() {
		int hash = row;
		hash = 31 * hash + col;
		return hash;
	}

	@Override
	public String toString() {
		return displayString;
	}

}

@@ -1187,50 +1187,154 @@
 ) %7B%0A
-%09%09if (o == null) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09
+        if (this == o) %7B%0A            return true;%0A        %7D%0A        if (!(o instanceof Coordinate)) %7B%0A            return false;%0A        %7D%0A        
 Coor

Equals method for org.drools.guvnor.client.decisiontable.widget.Coordinate assumes the argument is of type Coordinate