/** * Adds an element to the buffer. * <p> * The element added will be sorted according to the comparator in use. * * @param element the element to be added * @return true always */ public boolean add(Object element) { if (isAtCapacity()) { grow(); } // percolate element to it's place in tree if (ascendingOrder) { percolateUpMinHeap(element); } else { percolateUpMaxHeap(element); } return true; }
/** * Adds an element to the buffer. * <p> * The element added will be sorted according to the comparator in use. * * @param element the element to be added * @return true always */ public boolean add(Object element) { if (isAtCapacity()) { grow(); } // percolate element to it's place in tree if (ascendingOrder) { percolateUpMinHeap(element); } else { percolateUpMaxHeap(element); } return true; }
/** * Adds an element to the buffer. * <p> * The element added will be sorted according to the comparator in use. * * @param element the element to be added * @return true always */ public boolean add(Object element) { if (isAtCapacity()) { grow(); } // percolate element to it's place in tree if (ascendingOrder) { percolateUpMinHeap(element); } else { percolateUpMaxHeap(element); } return true; }
/** * Adds an element to the buffer. * <p> * The element added will be sorted according to the comparator in use. * * @param element the element to be added * @return true always */ public boolean add(Object element) { if (isAtCapacity()) { grow(); } // percolate element to it's place in tree if (ascendingOrder) { percolateUpMinHeap(element); } else { percolateUpMaxHeap(element); } return true; }
/** * Adds an element to the buffer. * <p> * The element added will be sorted according to the comparator in use. * * @param element the element to be added * @return true always */ public boolean add(Object element) { if (isAtCapacity()) { grow(); } // percolate element to it's place in tree if (ascendingOrder) { percolateUpMinHeap(element); } else { percolateUpMaxHeap(element); } return true; }
/** * Adds an element to the buffer. * <p> * The element added will be sorted according to the comparator in use. * * @param element the element to be added * @return true always */ public boolean add(Object element) { if (isAtCapacity()) { grow(); } // percolate element to it's place in tree if (ascendingOrder) { percolateUpMinHeap(element); } else { percolateUpMaxHeap(element); } return true; }
/** * Adds an element to the buffer. * <p> * The element added will be sorted according to the comparator in use. * * @param element the element to be added * @return true always */ public boolean add(Object element) { if (isAtCapacity()) { grow(); } // percolate element to it's place in tree if (ascendingOrder) { percolateUpMinHeap(element); } else { percolateUpMaxHeap(element); } return true; }