1 |
< |
package java.util; |
1 |
> |
/* |
2 |
> |
* %W% %E% |
3 |
> |
* |
4 |
> |
* Copyright 2003 Sun Microsystems, Inc. All rights reserved. |
5 |
> |
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. |
6 |
> |
*/ |
7 |
> |
|
8 |
> |
package java.util; |
9 |
|
|
10 |
|
/** |
11 |
|
* An unbounded priority {@linkplain Queue queue} based on a priority heap. |
55 |
|
* <a href="{@docRoot}/../guide/collections/index.html"> |
56 |
|
* Java Collections Framework</a>. |
57 |
|
* @since 1.5 |
58 |
+ |
* @version %I%, %G% |
59 |
|
* @author Josh Bloch |
60 |
|
*/ |
61 |
|
public class PriorityQueue<E> extends AbstractQueue<E> |
470 |
|
cursor--; |
471 |
|
} else { |
472 |
|
if (forgetMeNot == null) |
473 |
< |
forgetMeNot = new ArrayList(); |
473 |
> |
forgetMeNot = new ArrayList<E>(); |
474 |
|
forgetMeNot.add(moved); |
475 |
|
} |
476 |
|
} else if (lastRetElt != null) { |
677 |
|
|
678 |
|
// Read in all elements in the proper order. |
679 |
|
for (int i=0; i<size; i++) |
680 |
< |
queue[i] = s.readObject(); |
680 |
> |
queue[i] = (E) s.readObject(); |
681 |
|
} |
682 |
|
|
683 |
|
} |