522 |
|
*/ |
523 |
|
private int expectedModCount = modCount; |
524 |
|
|
525 |
+ |
Itr() {} // prevent access constructor creation |
526 |
+ |
|
527 |
|
public boolean hasNext() { |
528 |
|
return cursor < size || |
529 |
|
(forgetMeNot != null && !forgetMeNot.isEmpty()); |
633 |
|
* promoting x up the tree until it is greater than or equal to |
634 |
|
* its parent, or is the root. |
635 |
|
* |
636 |
< |
* To simplify and speed up coercions and comparisons. the |
636 |
> |
* To simplify and speed up coercions and comparisons, the |
637 |
|
* Comparable and Comparator versions are separated into different |
638 |
|
* methods that are otherwise identical. (Similarly for siftDown.) |
639 |
|
* |
734 |
|
@SuppressWarnings("unchecked") |
735 |
|
private void heapify() { |
736 |
|
final Object[] es = queue; |
737 |
< |
final int half = (size >>> 1) - 1; |
737 |
> |
int i = (size >>> 1) - 1; |
738 |
|
if (comparator == null) |
739 |
< |
for (int i = half; i >= 0; i--) |
739 |
> |
for (; i >= 0; i--) |
740 |
|
siftDownComparable(i, (E) es[i]); |
741 |
|
else |
742 |
< |
for (int i = half; i >= 0; i--) |
742 |
> |
for (; i >= 0; i--) |
743 |
|
siftDownUsingComparator(i, (E) es[i]); |
744 |
|
} |
745 |
|
|