diff --git a/src/main/java/datastructures/worklists/CircularArrayFIFOQueue.java b/src/main/java/datastructures/worklists/CircularArrayFIFOQueue.java index 4e92774fbfa366bf811e3056d0628334eb58d8d6..412244ab58258c3f3d3559e85d5dd33440f2c151 100644 --- a/src/main/java/datastructures/worklists/CircularArrayFIFOQueue.java +++ b/src/main/java/datastructures/worklists/CircularArrayFIFOQueue.java @@ -3,18 +3,11 @@ package datastructures.worklists; import cse332.exceptions.NotYetImplementedException; import cse332.interfaces.worklists.FixedSizeFIFOWorkList; -import java.util.NoSuchElementException; - /** * See cse332/interfaces/worklists/FixedSizeFIFOWorkList.java * for method specifications. */ -public class CircularArrayFIFOQueue<E extends Comparable<E>> extends FixedSizeFIFOWorkList<E> { - - private E[] queue; - private int front; - private int size; - +public class CircularArrayFIFOQueue<E> extends FixedSizeFIFOWorkList<E> { public CircularArrayFIFOQueue(int capacity) { super(capacity); throw new NotYetImplementedException(); @@ -57,17 +50,31 @@ public class CircularArrayFIFOQueue<E extends Comparable<E>> extends FixedSizeFI @Override public int compareTo(FixedSizeFIFOWorkList<E> other) { + // You will implement this method in project 2. Leave this method unchanged for project 1. throw new NotYetImplementedException(); } @Override @SuppressWarnings("unchecked") public boolean equals(Object obj) { - throw new NotYetImplementedException(); + // You will finish implementing this method in project 2. Leave this method unchanged for project 1. + if (this == obj) { + return true; + } else if (!(obj instanceof FixedSizeFIFOWorkList<?>)) { + return false; + } else { + // Uncomment the line below for p2 when you implement equals + // FixedSizeFIFOWorkList<E> other = (FixedSizeFIFOWorkList<E>) obj; + + // Your code goes here + + throw new NotYetImplementedException(); + } } @Override public int hashCode() { + // You will implement this method in project 2. Leave this method unchanged for project 1. throw new NotYetImplementedException(); } }