@@ -12,15 +12,15 @@ module Collection
1212 #
1313 # The API is based on the `Queue` class from the Ruby standard library.
1414 #
15- # The pure Ruby implementation, `MutexPriorityQueue ` uses a heap algorithm
15+ # The pure Ruby implementation, `RubyNonConcurrentPriorityQueue ` uses a heap algorithm
1616 # stored in an array. The algorithm is based on the work of Robert Sedgewick
1717 # and Kevin Wayne.
1818 #
1919 # The JRuby native implementation is a thin wrapper around the standard
20- # library `java.util.PriorityQueue `.
20+ # library `java.util.NonConcurrentPriorityQueue `.
2121 #
22- # When running under JRuby the class `PriorityQueue ` extends `JavaPriorityQueue `.
23- # When running under all other interpreters it extends `MutexPriorityQueue `.
22+ # When running under JRuby the class `NonConcurrentPriorityQueue ` extends `JavaNonConcurrentPriorityQueue `.
23+ # When running under all other interpreters it extends `RubyNonConcurrentPriorityQueue `.
2424 #
2525 # @note This implementation is *not* thread safe.
2626 #
@@ -30,11 +30,11 @@ module Collection
3030 # @see http://algs4.cs.princeton.edu/24pq/index.php#2.6
3131 # @see http://algs4.cs.princeton.edu/24pq/MaxPQ.java.html
3232 #
33- # @see http://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue .html
33+ # @see http://docs.oracle.com/javase/7/docs/api/java/util/NonConcurrentPriorityQueue .html
3434 #
3535 # @!visibility private
3636 # @!macro internal_implementation_note
37- class MutexPriorityQueue
37+ class RubyNonConcurrentPriorityQueue
3838
3939 # @!macro [attach] priority_queue_method_initialize
4040 #
@@ -161,7 +161,7 @@ def push(item)
161161 # @param [Enumerable] list the list to build the queue from
162162 # @param [Hash] opts the options for creating the queue
163163 #
164- # @return [PriorityQueue ] the newly created and populated queue
164+ # @return [NonConcurrentPriorityQueue ] the newly created and populated queue
165165 def self . from_list ( list , opts = { } )
166166 queue = new ( opts )
167167 list . each { |item | queue << item }
@@ -229,7 +229,7 @@ def swim(k)
229229 #
230230 # @!visibility private
231231 # @!macro internal_implementation_note
232- class JavaPriorityQueue
232+ class JavaNonConcurrentPriorityQueue
233233
234234 # @!macro priority_queue_method_initialize
235235 def initialize ( opts = { } )
@@ -303,18 +303,18 @@ def self.from_list(list, opts = {})
303303
304304 # @!visibility private
305305 # @!macro internal_implementation_note
306- PriorityQueueImplementation = case
307- when Concurrent . on_jruby?
308- JavaPriorityQueue
309- else
310- MutexPriorityQueue
311- end
312- private_constant :PriorityQueueImplementation
306+ NonConcurrentPriorityQueueImplementation = case
307+ when Concurrent . on_jruby?
308+ JavaNonConcurrentPriorityQueue
309+ else
310+ RubyNonConcurrentPriorityQueue
311+ end
312+ private_constant :NonConcurrentPriorityQueueImplementation
313313
314314 # @!macro priority_queue
315315 #
316316 # @!visibility private
317- class PriorityQueue < PriorityQueueImplementation
317+ class NonConcurrentPriorityQueue < NonConcurrentPriorityQueueImplementation
318318
319319 alias_method :has_priority? , :include?
320320
0 commit comments