Commit dc3bc8fd authored by Rohit Prasad's avatar Rohit Prasad

Implement hashCode method

parent a9768b27
...@@ -43,6 +43,13 @@ public abstract class Order { ...@@ -43,6 +43,13 @@ public abstract class Order {
void setQty(int qty) { this.qty = qty; } void setQty(int qty) { this.qty = qty; }
@Override
public int hashCode() {
// in current implementation, time is assured to
// be unique
return this.time;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
// self check // self check
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment