Back to project page ZorbsCity.
The source code is released under:
GNU General Public License
If you think the Android project ZorbsCity listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package jonathan.geoffroy.zorbscity.model.helpers; /*ww w. jav a2 s . com*/ import java.io.Serializable; import jonathan.geoffroy.zorbscity.model.cityObjects.buildings.Building; /** * An Helper to encapsulate x & y coordinates * @author Jonathan GEOFFROY * @version 0.1 */ public class Coord2D implements Serializable { /** * auto-generated serial (using eclipse) */ private static final long serialVersionUID = -631636098282551538L; public int x, y; public Coord2D() {} public Coord2D(int x, int y) { super(); this.x = x; this.y = y; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + x; result = prime * result + y; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if(obj instanceof Coord2D) { Coord2D other = (Coord2D) obj; return x == other.x && y == other.y; } else if(obj instanceof Building) { Building b = (Building)obj; return b.equals(this); } return false; } }