T function ( ) { return null ; }
this method can be overridden by extending classes to return a sentinel object which will be used by the priorityqueue #priorityqueue int , boolean constructor to fill the queue , so that the code which uses that queue can always assume it 's full and only change the top without attempting to insert any new object . those sentinel values should always compare worse than any non-sentinel value i.e. , #lessthan should always favor thenon-sentinel values . by default , this method returns false , which means the queue will not be filled with sentinel values . otherwise , the value returned will be used to pre-populate the queue . adds sentinel values to the queue . if this method is extended to return a non-null value , then the following usage pattern is recommended : / / extends getsentinelobject to return a non-null value . priorityqueue < myobject > pq = new myqueue < myobject > numhits ; / / save the ` top ' element , which is guaranteed to not be null . myobject pqtop = pq.top ; < ... > / / now in order to add a new element , which is ` better ' than top after / / you 've verified it is better , it is as simple as : pqtop.change . pqtop = pq.updatetop ; note : if this method returns a non-null value , it will be called by the priorityqueue #priorityqueue int , boolean constructor #size times , relying on a new object to be returned and will notcheck if it 's null again . therefore you should ensure any call to this method creates a new instance and behaves consistently , e.g. , it can not return null if it previously returned non-null . concode_field_sep int size concode_elem_sep int maxSize concode_elem_sep T[] heap concode_field_sep T add concode_elem_sep T pop concode_elem_sep Object[] getHeapArray concode_elem_sep T top concode_elem_sep int size concode_elem_sep void upHeap concode_elem_sep void downHeap concode_elem_sep boolean lessThan concode_elem_sep void clear concode_elem_sep T insertWithOverflow concode_elem_sep T updateTop