1: /** 2: An interface for the ADT maxheap. 3: 4: @author Frank M. Carrano 5: @author Timothy M. Henry 6: @version 4.0 7: */ 8: public interface MaxHeapInterface<T extends Comparable<? super T>> 9: { 10: /** Adds a new entry to this heap. 11: @param newEntry An object to be added. */ 12: public void add(T newEntry); 13: 14: /** Removes and returns the largest item in this heap. 15: @return Either the largest object in the heap or, 16: if the heap is empty before the operation, null. */ 17: public T removeMax(); 18: 19: /** Retrieves the largest item in this heap. 20: @return Either the largest object in the heap or, 21: if the heap is empty, null. */ 22: public T getMax(); 23: 24: /** Detects whether this heap is empty. 25: @return True if the heap is empty, or false otherwise. */ 26: public boolean isEmpty(); 27: 28: /** Gets the size of this heap. 29: @return The number of entries currently in the heap. */ 30: public int getSize(); 31: 32: /** Removes all entries from this heap. */ 33: public void clear(); 34: } // end MaxHeapInterface