Created
March 7, 2015 08:53
-
-
Save novoj/18027673802482c259e8 to your computer and use it in GitHub Desktop.
Equals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean equals(Object o) { | |
if(this == o) return true; | |
if(o == null || getClass() != o.getClass()) return false; | |
Cell cell = (Cell)o; | |
if(x != cell.x) return false; | |
if(y != cell.y) return false; | |
return true; | |
} | |
@Override | |
public int hashCode() { | |
int result = x; | |
result = 31 * result + y; | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment