added @override

This commit is contained in:
gishicrafter 2012-11-12 06:43:24 +09:00
parent 8466e4458f
commit 4a485a0d98

View file

@ -98,7 +98,7 @@ public class RefineryRecipe implements Comparable<RefineryRecipe> {
// Compares to only the types of source materials. // Compares to only the types of source materials.
// We consider non-null < null in order that one-ingredient recipe is checked after // We consider non-null < null in order that one-ingredient recipe is checked after
// the failure of matching two-ingredient recipes which include that liquid. // the failure of matching two-ingredient recipes which include that liquid.
@Override
public int compareTo(RefineryRecipe other) { public int compareTo(RefineryRecipe other) {
if(other == null) { if(other == null) {
@ -134,7 +134,7 @@ public class RefineryRecipe implements Comparable<RefineryRecipe> {
// equals() should be consistent with compareTo(). // equals() should be consistent with compareTo().
@Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj != null && obj instanceof RefineryRecipe) { if(obj != null && obj instanceof RefineryRecipe) {
return this.compareTo((RefineryRecipe)obj) == 0; return this.compareTo((RefineryRecipe)obj) == 0;
@ -143,7 +143,7 @@ public class RefineryRecipe implements Comparable<RefineryRecipe> {
} }
// hashCode() should be overridden because equals() was overridden. // hashCode() should be overridden because equals() was overridden.
@Override
public int hashCode() { public int hashCode() {
if(ingredient1 == null) { if(ingredient1 == null) {
return 0; return 0;