fix for calculator history equals

This commit is contained in:
serso 2011-10-16 15:28:46 +04:00
parent 4e36d2779e
commit caa5b3985f

View File

@ -51,4 +51,24 @@ public class CalculatorHistoryState extends AbstractHistoryState{
", displayState=" + displayState + ", displayState=" + displayState +
'}'; '}';
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CalculatorHistoryState that = (CalculatorHistoryState) o;
if (!displayState.equals(that.displayState)) return false;
if (!editorState.equals(that.editorState)) return false;
return true;
}
@Override
public int hashCode() {
int result = editorState.hashCode();
result = 31 * result + displayState.hashCode();
return result;
}
} }