Commit a0541d4d authored by Michael Lee's avatar Michael Lee
Browse files

Add generics boilerplate to .equals()

parent 887ed7c5
......@@ -49,19 +49,32 @@ public class CircularArrayFIFOQueue<E> extends FixedSizeFIFOWorkList<E> {
}
@Override
public int hashCode() {
public int compareTo(FixedSizeFIFOWorkList<E> o) {
// You will implement this method in p2. Leave this method unchanged for p1.
throw new NotYetImplementedException();
}
@Override
@SuppressWarnings("unchecked")
public boolean equals(Object obj) {
// You will implement this method in p2. Leave this method unchanged for p1.
throw new NotYetImplementedException();
// You will finish implementing this method in p2. Leave this method unchanged for p1.
if (this == obj) {
return true;
}
else if (!(obj instanceof FixedSizeFIFOWorkList<?>)) {
return false;
}
else {
FixedSizeFIFOWorkList<E> other = (FixedSizeFIFOWorkList<E>) obj;
// Your code goes here
throw new NotYetImplementedException();
}
}
@Override
public int compareTo(FixedSizeFIFOWorkList<E> o) {
public int hashCode() {
// You will implement this method in p2. Leave this method unchanged for p1.
throw new NotYetImplementedException();
}
......
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