159 |
|
* specified collection. The priority queue has an initial |
160 |
|
* capacity of 110% of the size of the specified collection or 1 |
161 |
|
* if the collection is empty. If the specified collection is an |
162 |
< |
* instance of a {@link SortedSet} or is another |
162 |
> |
* instance of a {@link java.util.SortedSet} or is another |
163 |
|
* <tt>PriorityQueue</tt>, the priority queue will be sorted |
164 |
|
* according to the same comparator, or according to its elements' |
165 |
|
* natural order if the collection is sorted according to its |
180 |
|
SortedSet<? extends E> s = (SortedSet<? extends E>) c; |
181 |
|
comparator = (Comparator<? super E>)s.comparator(); |
182 |
|
fillFromSorted(s); |
183 |
< |
} |
184 |
< |
else if (c instanceof PriorityQueue<? extends E>) { |
183 |
> |
} else if (c instanceof PriorityQueue<? extends E>) { |
184 |
|
PriorityQueue<? extends E> s = (PriorityQueue<? extends E>) c; |
185 |
|
comparator = (Comparator<? super E>)s.comparator(); |
186 |
|
fillFromSorted(s); |
187 |
< |
} |
189 |
< |
else { |
187 |
> |
} else { |
188 |
|
comparator = null; |
189 |
|
fillFromUnsorted(c); |
190 |
|
} |