176 |
|
*/ |
177 |
|
public PriorityQueue(Collection<? extends E> c) { |
178 |
|
initializeArray(c); |
179 |
< |
if (c instanceof SortedSet<? extends E>) { |
179 |
> |
if (c instanceof SortedSet) { |
180 |
|
SortedSet<? extends E> s = (SortedSet<? extends E>) c; |
181 |
|
comparator = (Comparator<? super E>)s.comparator(); |
182 |
|
fillFromSorted(s); |
183 |
< |
} else if (c instanceof PriorityQueue<? extends E>) { |
183 |
> |
} else if (c instanceof PriorityQueue) { |
184 |
|
PriorityQueue<? extends E> s = (PriorityQueue<? extends E>) c; |
185 |
|
comparator = (Comparator<? super E>)s.comparator(); |
186 |
|
fillFromSorted(s); |