The PriorityQueue class essentially maintains an ordered list.
priorityqueue类实质上维护了一个有序列表。
In this article, I'll look at three other changes: the updated Arrays and Collections classes and the new Queue interface, with its PriorityQueue implementation.
在本文中,我将研究其他三个变化:更新过的Arrays和collections类、新的Queue接口以及它的PriorityQueue实现。
Changing LinkedList in Listing 2 to PriorityQueue will result in Four being printed out instead of One, as Four comes first alphabetically — the natural ordering of strings.
将清单2中的LinkedList改变为PriorityQueue将会打印出Four而不是One,因为按字母排列——字符串的天然顺序——Four是第一个。
And, instead of creating your own subclasses, you can use one of the several built-in implementations, two of which aren't blocking queues: PriorityQueue and ConcurrentLinkedQueue.
而且,不必创建自己的子类,可以使用几个内置的实现,其中两个是不阻塞队列:PriorityQueue和ConcurrentLinked Queue。
And, instead of creating your own subclasses, you can use one of the several built-in implementations, two of which aren't blocking queues: PriorityQueue and ConcurrentLinkedQueue.
而且,不必创建自己的子类,可以使用几个内置的实现,其中两个是不阻塞队列:PriorityQueue和ConcurrentLinked Queue。
应用推荐