OLD | NEW |
1 dart_library.library('collection/priority_queue', null, /* Imports */[ | 1 dart_library.library('collection/priority_queue', null, /* Imports */[ |
2 "dart/_runtime", | 2 "dart/_runtime", |
3 'dart/core', | 3 'dart/core', |
4 'dart/collection' | 4 'dart/collection' |
5 ], /* Lazy imports */[ | 5 ], /* Lazy imports */[ |
6 ], function(exports, dart, core, collection) { | 6 ], function(exports, dart, core, collection) { |
7 'use strict'; | 7 'use strict'; |
8 let dartx = dart.dartx; | 8 let dartx = dart.dartx; |
9 let PriorityQueue$ = dart.generic(function(E) { | 9 let PriorityQueue$ = dart.generic(function(E) { |
10 class PriorityQueue extends core.Object {} | 10 class PriorityQueue extends core.Object {} |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 let last = this[_removeLast](); | 90 let last = this[_removeLast](); |
91 if (dart.notNull(this[_length]) > 0) { | 91 if (dart.notNull(this[_length]) > 0) { |
92 this[_bubbleDown](last, 0); | 92 this[_bubbleDown](last, 0); |
93 } | 93 } |
94 return result; | 94 return result; |
95 } | 95 } |
96 toList() { | 96 toList() { |
97 let list = core.List$(E).new(); | 97 let list = core.List$(E).new(); |
98 list[dartx.length] = this[_length]; | 98 list[dartx.length] = this[_length]; |
99 list[dartx.setRange](0, this[_length], this[_queue]); | 99 list[dartx.setRange](0, this[_length], this[_queue]); |
100 list[dartx.sort](dart.as(this.comparison, __CastType0)); | 100 list[dartx.sort](dart.as(this.comparison, __CastType0$(E))); |
101 return list; | 101 return list; |
102 } | 102 } |
103 toSet() { | 103 toSet() { |
104 let set = new (collection.SplayTreeSet$(E))(dart.as(this.comparison, dar
t.functionType(core.int, [E, E]))); | 104 let set = new (collection.SplayTreeSet$(E))(dart.as(this.comparison, dar
t.functionType(core.int, [E, E]))); |
105 for (let i = 0; dart.notNull(i) < dart.notNull(this[_length]); i = dart.
notNull(i) + 1) { | 105 for (let i = 0; dart.notNull(i) < dart.notNull(this[_length]); i = dart.
notNull(i) + 1) { |
106 set.add(this[_queue][dartx.get](i)); | 106 set.add(this[_queue][dartx.get](i)); |
107 } | 107 } |
108 return set; | 108 return set; |
109 } | 109 } |
110 toString() { | 110 toString() { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(core.i
nt, [E, E])); | 241 let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(core.i
nt, [E, E])); |
242 return __CastType0; | 242 return __CastType0; |
243 }); | 243 }); |
244 let __CastType0 = __CastType0$(); | 244 let __CastType0 = __CastType0$(); |
245 // Exports: | 245 // Exports: |
246 exports.PriorityQueue$ = PriorityQueue$; | 246 exports.PriorityQueue$ = PriorityQueue$; |
247 exports.PriorityQueue = PriorityQueue; | 247 exports.PriorityQueue = PriorityQueue; |
248 exports.HeapPriorityQueue$ = HeapPriorityQueue$; | 248 exports.HeapPriorityQueue$ = HeapPriorityQueue$; |
249 exports.HeapPriorityQueue = HeapPriorityQueue; | 249 exports.HeapPriorityQueue = HeapPriorityQueue; |
250 }); | 250 }); |
OLD | NEW |