Skip to content

Instantly share code, notes, and snippets.

@novoj
Created March 7, 2015 08:53
Show Gist options
  • Save novoj/18027673802482c259e8 to your computer and use it in GitHub Desktop.
Save novoj/18027673802482c259e8 to your computer and use it in GitHub Desktop.
Equals
@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