
package kr.ac.kaist.ds.groupd.search;

import java.util.Comparator;
import java.util.PriorityQueue;

public class SearchQueryPriorityQueue<E> extends PriorityQueue<E> {
    private static final long serialVersionUID = 1L;

    private final int fixedSizeOfQueue;

    public SearchQueryPriorityQueue(int initialCapacity, Comparator<? super E> comparator) {
        super(initialCapacity, comparator);
        this.fixedSizeOfQueue = initialCapacity;
    }

    @Override
    public boolean add(E e) {
        if (this.size() >= fixedSizeOfQueue) {
            if (null != remove())
                return super.add(e);
            return false;
        }
        return super.add(e);
    }
}

@@ -484,19 +484,21 @@
 boolean 
-add
+offer
 (E e) %7B%0A
@@ -599,35 +599,37 @@
    return super.
-add
+offer
 (e);%0A           
@@ -678,11 +678,13 @@
 per.
-add
+offer
 (e);
@@ -690,10 +690,11 @@
 ;%0A    %7D%0A
+%0A
 %7D%0A

change the add to the offer