OLD | NEW |
1 var collection; | 1 var collection; |
2 (function(collection) { | 2 (function(collection) { |
3 'use strict'; | 3 'use strict'; |
| 4 let _length = Symbol('_length'); |
| 5 let _strings = Symbol('_strings'); |
| 6 let _nums = Symbol('_nums'); |
| 7 let _rest = Symbol('_rest'); |
| 8 let _keys = Symbol('_keys'); |
| 9 let _containsKey = Symbol('_containsKey'); |
| 10 let _getBucket = Symbol('_getBucket'); |
| 11 let _findBucketIndex = Symbol('_findBucketIndex'); |
| 12 let _computeKeys = Symbol('_computeKeys'); |
| 13 let _get = Symbol('_get'); |
| 14 let _addHashTableEntry = Symbol('_addHashTableEntry'); |
| 15 let _set = Symbol('_set'); |
| 16 let _computeHashCode = Symbol('_computeHashCode'); |
| 17 let _removeHashTableEntry = Symbol('_removeHashTableEntry'); |
| 18 let _remove = Symbol('_remove'); |
| 19 let _isStringKey = Symbol('_isStringKey'); |
| 20 let _isNumericKey = Symbol('_isNumericKey'); |
| 21 let _hasTableEntry = Symbol('_hasTableEntry'); |
| 22 let _getTableEntry = Symbol('_getTableEntry'); |
| 23 let _setTableEntry = Symbol('_setTableEntry'); |
| 24 let _deleteTableEntry = Symbol('_deleteTableEntry'); |
| 25 let _newHashTable = Symbol('_newHashTable'); |
| 26 let _equals = Symbol('_equals'); |
| 27 let _hashCode = Symbol('_hashCode'); |
| 28 let _validKey = Symbol('_validKey'); |
| 29 let _map = Symbol('_map'); |
| 30 let _offset = Symbol('_offset'); |
| 31 let _current = Symbol('_current'); |
| 32 let _first = Symbol('_first'); |
| 33 let _last = Symbol('_last'); |
| 34 let _modifications = Symbol('_modifications'); |
| 35 let _value = Symbol('_value'); |
| 36 let _newLinkedCell = Symbol('_newLinkedCell'); |
| 37 let _unlinkCell = Symbol('_unlinkCell'); |
| 38 let _modified = Symbol('_modified'); |
| 39 let _key = Symbol('_key'); |
| 40 let _next = Symbol('_next'); |
| 41 let _previous = Symbol('_previous'); |
| 42 let _cell = Symbol('_cell'); |
| 43 let _elements = Symbol('_elements'); |
| 44 let _newSet = Symbol('_newSet'); |
| 45 let _computeElements = Symbol('_computeElements'); |
| 46 let _contains = Symbol('_contains'); |
| 47 let _lookup = Symbol('_lookup'); |
| 48 let _add = Symbol('_add'); |
| 49 let _isStringElement = Symbol('_isStringElement'); |
| 50 let _isNumericElement = Symbol('_isNumericElement'); |
| 51 let _equality = Symbol('_equality'); |
| 52 let _hasher = Symbol('_hasher'); |
| 53 let _unsupported = Symbol('_unsupported'); |
| 54 let _element = Symbol('_element'); |
| 55 let _filterWhere = Symbol('_filterWhere'); |
| 56 let _source = Symbol('_source'); |
| 57 let _isToStringVisiting = Symbol('_isToStringVisiting'); |
| 58 let _iterablePartsToStrings = Symbol('_iterablePartsToStrings'); |
| 59 let _iterator = Symbol('_iterator'); |
| 60 let _state = Symbol('_state'); |
| 61 let _move = Symbol('_move'); |
| 62 let _modificationCount = Symbol('_modificationCount'); |
| 63 let _insertAfter = Symbol('_insertAfter'); |
| 64 let _list = Symbol('_list'); |
| 65 let _unlink = Symbol('_unlink'); |
| 66 let _filter = Symbol('_filter'); |
| 67 let _toStringVisiting = Symbol('_toStringVisiting'); |
| 68 let _id = Symbol('_id'); |
| 69 let _fillMapWithMappedIterable = Symbol('_fillMapWithMappedIterable'); |
| 70 let _fillMapWithIterables = Symbol('_fillMapWithIterables'); |
| 71 let _link = Symbol('_link'); |
| 72 let _asNonSentinelEntry = Symbol('_asNonSentinelEntry'); |
| 73 let _sentinel = Symbol('_sentinel'); |
| 74 let _elementCount = Symbol('_elementCount'); |
| 75 let _nextEntry = Symbol('_nextEntry'); |
| 76 let _head = Symbol('_head'); |
| 77 let _tail = Symbol('_tail'); |
| 78 let _table = Symbol('_table'); |
| 79 let _checkModification = Symbol('_checkModification'); |
| 80 let _writeToList = Symbol('_writeToList'); |
| 81 let _preGrow = Symbol('_preGrow'); |
| 82 let _grow = Symbol('_grow'); |
| 83 let _isPowerOf2 = Symbol('_isPowerOf2'); |
| 84 let _nextPowerOf2 = Symbol('_nextPowerOf2'); |
| 85 let _queue = Symbol('_queue'); |
| 86 let _end = Symbol('_end'); |
| 87 let _position = Symbol('_position'); |
| 88 let _dummy = Symbol('_dummy'); |
| 89 let _root = Symbol('_root'); |
| 90 let _count = Symbol('_count'); |
| 91 let _splayCount = Symbol('_splayCount'); |
| 92 let _splay = Symbol('_splay'); |
| 93 let _compare = Symbol('_compare'); |
| 94 let _splayMin = Symbol('_splayMin'); |
| 95 let _splayMax = Symbol('_splayMax'); |
| 96 let _addNewRoot = Symbol('_addNewRoot'); |
| 97 let _clear = Symbol('_clear'); |
| 98 let _comparator = Symbol('_comparator'); |
| 99 let _workList = Symbol('_workList'); |
| 100 let _tree = Symbol('_tree'); |
| 101 let _currentNode = Symbol('_currentNode'); |
| 102 let _findLeftMostDescendent = Symbol('_findLeftMostDescendent'); |
| 103 let _getValue = Symbol('_getValue'); |
| 104 let _rebuildWorkList = Symbol('_rebuildWorkList'); |
| 105 let _clone = Symbol('_clone'); |
| 106 let _copyNode = Symbol('_copyNode'); |
4 let _HashMap$ = dart.generic(function(K, V) { | 107 let _HashMap$ = dart.generic(function(K, V) { |
5 class _HashMap extends dart.Object { | 108 class _HashMap extends dart.Object { |
6 _HashMap() { | 109 _HashMap() { |
7 this._length = 0; | 110 this[_length] = 0; |
8 this._strings = null; | 111 this[_strings] = null; |
9 this._nums = null; | 112 this[_nums] = null; |
10 this._rest = null; | 113 this[_rest] = null; |
11 this._keys = null; | 114 this[_keys] = null; |
12 } | 115 } |
13 get length() { | 116 get length() { |
14 return this._length; | 117 return this[_length]; |
15 } | 118 } |
16 get isEmpty() { | 119 get isEmpty() { |
17 return this._length === 0; | 120 return this[_length] === 0; |
18 } | 121 } |
19 get isNotEmpty() { | 122 get isNotEmpty() { |
20 return !dart.notNull(this.isEmpty); | 123 return !dart.notNull(this.isEmpty); |
21 } | 124 } |
22 get keys() { | 125 get keys() { |
23 return new HashMapKeyIterable(this); | 126 return new HashMapKeyIterable(this); |
24 } | 127 } |
25 get values() { | 128 get values() { |
26 return new _internal.MappedIterable(this.keys, ((each) => this.get(each)
).bind(this)); | 129 return new _internal.MappedIterable(this.keys, ((each) => this.get(each)
).bind(this)); |
27 } | 130 } |
28 containsKey(key) { | 131 containsKey(key) { |
29 if (_isStringKey(key)) { | 132 if (_isStringKey(key)) { |
30 let strings = this._strings; | 133 let strings = this[_strings]; |
31 return strings === null ? false : _hasTableEntry(strings, key); | 134 return strings === null ? false : _hasTableEntry(strings, key); |
32 } else if (_isNumericKey(key)) { | 135 } else if (_isNumericKey(key)) { |
33 let nums = this._nums; | 136 let nums = this[_nums]; |
34 return nums === null ? false : _hasTableEntry(nums, key); | 137 return nums === null ? false : _hasTableEntry(nums, key); |
35 } else { | 138 } else { |
36 return this._containsKey(key); | 139 return this[_containsKey](key); |
37 } | 140 } |
38 } | 141 } |
39 _containsKey(key) { | 142 [_containsKey](key) { |
40 let rest = this._rest; | 143 let rest = this[_rest]; |
41 if (rest === null) | 144 if (rest === null) |
42 return false; | 145 return false; |
43 let bucket = this._getBucket(rest, key); | 146 let bucket = this[_getBucket](rest, key); |
44 return this._findBucketIndex(bucket, key) >= 0; | 147 return this[_findBucketIndex](bucket, key) >= 0; |
45 } | 148 } |
46 containsValue(value) { | 149 containsValue(value) { |
47 return this._computeKeys().any(((each) => dart.equals(this.get(each), va
lue)).bind(this)); | 150 return this[_computeKeys]().any(((each) => dart.equals(this.get(each), v
alue)).bind(this)); |
48 } | 151 } |
49 addAll(other) { | 152 addAll(other) { |
50 other.forEach(((key, value) => { | 153 other.forEach(((key, value) => { |
51 this.set(key, value); | 154 this.set(key, value); |
52 }).bind(this)); | 155 }).bind(this)); |
53 } | 156 } |
54 get(key) { | 157 get(key) { |
55 if (_isStringKey(key)) { | 158 if (_isStringKey(key)) { |
56 let strings = this._strings; | 159 let strings = this[_strings]; |
57 return dart.as(strings === null ? null : _getTableEntry(strings, key),
V); | 160 return dart.as(strings === null ? null : _getTableEntry(strings, key),
V); |
58 } else if (_isNumericKey(key)) { | 161 } else if (_isNumericKey(key)) { |
59 let nums = this._nums; | 162 let nums = this[_nums]; |
60 return dart.as(nums === null ? null : _getTableEntry(nums, key), V); | 163 return dart.as(nums === null ? null : _getTableEntry(nums, key), V); |
61 } else { | 164 } else { |
62 return this._get(key); | 165 return this[_get](key); |
63 } | 166 } |
64 } | 167 } |
65 _get(key) { | 168 [_get](key) { |
66 let rest = this._rest; | 169 let rest = this[_rest]; |
67 if (rest === null) | 170 if (rest === null) |
68 return dart.as(null, V); | 171 return dart.as(null, V); |
69 let bucket = this._getBucket(rest, key); | 172 let bucket = this[_getBucket](rest, key); |
70 let index = this._findBucketIndex(bucket, key); | 173 let index = this[_findBucketIndex](bucket, key); |
71 return dart.as(index < 0 ? null : bucket[index + 1], V); | 174 return dart.as(index < 0 ? null : bucket[index + 1], V); |
72 } | 175 } |
73 set(key, value) { | 176 set(key, value) { |
74 if (_isStringKey(key)) { | 177 if (_isStringKey(key)) { |
75 let strings = this._strings; | 178 let strings = this[_strings]; |
76 if (strings === null) | 179 if (strings === null) |
77 this._strings = strings = _newHashTable(); | 180 this[_strings] = strings = _newHashTable(); |
78 this._addHashTableEntry(strings, key, value); | 181 this[_addHashTableEntry](strings, key, value); |
79 } else if (_isNumericKey(key)) { | 182 } else if (_isNumericKey(key)) { |
80 let nums = this._nums; | 183 let nums = this[_nums]; |
81 if (nums === null) | 184 if (nums === null) |
82 this._nums = nums = _newHashTable(); | 185 this[_nums] = nums = _newHashTable(); |
83 this._addHashTableEntry(nums, key, value); | 186 this[_addHashTableEntry](nums, key, value); |
84 } else { | 187 } else { |
85 this._set(key, value); | 188 this[_set](key, value); |
86 } | 189 } |
87 } | 190 } |
88 _set(key, value) { | 191 [_set](key, value) { |
89 let rest = this._rest; | 192 let rest = this[_rest]; |
90 if (rest === null) | 193 if (rest === null) |
91 this._rest = rest = _newHashTable(); | 194 this[_rest] = rest = _newHashTable(); |
92 let hash = this._computeHashCode(key); | 195 let hash = this[_computeHashCode](key); |
93 let bucket = rest[hash]; | 196 let bucket = rest[hash]; |
94 if (bucket === null) { | 197 if (bucket === null) { |
95 _setTableEntry(rest, hash, [key, value]); | 198 _setTableEntry(rest, hash, [key, value]); |
96 this._length++; | 199 this[_length]++; |
97 this._keys = null; | 200 this[_keys] = null; |
98 } else { | 201 } else { |
99 let index = this._findBucketIndex(bucket, key); | 202 let index = this[_findBucketIndex](bucket, key); |
100 if (index >= 0) { | 203 if (index >= 0) { |
101 bucket[index + 1] = value; | 204 bucket[index + 1] = value; |
102 } else { | 205 } else { |
103 bucket.push(key, value); | 206 bucket.push(key, value); |
104 this._length++; | 207 this[_length]++; |
105 this._keys = null; | 208 this[_keys] = null; |
106 } | 209 } |
107 } | 210 } |
108 } | 211 } |
109 putIfAbsent(key, ifAbsent) { | 212 putIfAbsent(key, ifAbsent) { |
110 if (this.containsKey(key)) | 213 if (this.containsKey(key)) |
111 return this.get(key); | 214 return this.get(key); |
112 let value = ifAbsent(); | 215 let value = ifAbsent(); |
113 this.set(key, value); | 216 this.set(key, value); |
114 return value; | 217 return value; |
115 } | 218 } |
116 remove(key) { | 219 remove(key) { |
117 if (_isStringKey(key)) { | 220 if (_isStringKey(key)) { |
118 return this._removeHashTableEntry(this._strings, key); | 221 return this[_removeHashTableEntry](this[_strings], key); |
119 } else if (_isNumericKey(key)) { | 222 } else if (_isNumericKey(key)) { |
120 return this._removeHashTableEntry(this._nums, key); | 223 return this[_removeHashTableEntry](this[_nums], key); |
121 } else { | 224 } else { |
122 return this._remove(key); | 225 return this[_remove](key); |
123 } | 226 } |
124 } | 227 } |
125 _remove(key) { | 228 [_remove](key) { |
126 let rest = this._rest; | 229 let rest = this[_rest]; |
127 if (rest === null) | 230 if (rest === null) |
128 return dart.as(null, V); | 231 return dart.as(null, V); |
129 let bucket = this._getBucket(rest, key); | 232 let bucket = this[_getBucket](rest, key); |
130 let index = this._findBucketIndex(bucket, key); | 233 let index = this[_findBucketIndex](bucket, key); |
131 if (index < 0) | 234 if (index < 0) |
132 return dart.as(null, V); | 235 return dart.as(null, V); |
133 this._length--; | 236 this[_length]--; |
134 this._keys = null; | 237 this[_keys] = null; |
135 return dart.as(bucket.splice(index, 2)[1], V); | 238 return dart.as(bucket.splice(index, 2)[1], V); |
136 } | 239 } |
137 clear() { | 240 clear() { |
138 if (this._length > 0) { | 241 if (this[_length] > 0) { |
139 this._strings = this._nums = this._rest = this._keys = null; | 242 this[_strings] = this[_nums] = this[_rest] = this[_keys] = null; |
140 this._length = 0; | 243 this[_length] = 0; |
141 } | 244 } |
142 } | 245 } |
143 forEach(action) { | 246 forEach(action) { |
144 let keys = this._computeKeys(); | 247 let keys = this[_computeKeys](); |
145 for (let i = 0, length = keys.length; i < length; i++) { | 248 for (let i = 0, length = keys.length; i < length; i++) { |
146 let key = keys[i]; | 249 let key = keys[i]; |
147 action(dart.as(key, K), this.get(key)); | 250 action(dart.as(key, K), this.get(key)); |
148 if (keys !== this._keys) { | 251 if (keys !== this[_keys]) { |
149 throw new core.ConcurrentModificationError(this); | 252 throw new core.ConcurrentModificationError(this); |
150 } | 253 } |
151 } | 254 } |
152 } | 255 } |
153 _computeKeys() { | 256 [_computeKeys]() { |
154 if (this._keys !== null) | 257 if (this[_keys] !== null) |
155 return this._keys; | 258 return this[_keys]; |
156 let result = new core.List(this._length); | 259 let result = new core.List(this[_length]); |
157 let index = 0; | 260 let index = 0; |
158 let strings = this._strings; | 261 let strings = this[_strings]; |
159 if (strings !== null) { | 262 if (strings !== null) { |
160 let names = Object.getOwnPropertyNames(strings); | 263 let names = Object.getOwnPropertyNames(strings); |
161 let entries = names.length; | 264 let entries = names.length; |
162 for (let i = 0; i < entries; i++) { | 265 for (let i = 0; i < entries; i++) { |
163 let key = names[i]; | 266 let key = names[i]; |
164 result[index] = key; | 267 result[index] = key; |
165 index++; | 268 index++; |
166 } | 269 } |
167 } | 270 } |
168 let nums = this._nums; | 271 let nums = this[_nums]; |
169 if (nums !== null) { | 272 if (nums !== null) { |
170 let names = Object.getOwnPropertyNames(nums); | 273 let names = Object.getOwnPropertyNames(nums); |
171 let entries = names.length; | 274 let entries = names.length; |
172 for (let i = 0; i < entries; i++) { | 275 for (let i = 0; i < entries; i++) { |
173 let key = +names[i]; | 276 let key = +names[i]; |
174 result[index] = key; | 277 result[index] = key; |
175 index++; | 278 index++; |
176 } | 279 } |
177 } | 280 } |
178 let rest = this._rest; | 281 let rest = this[_rest]; |
179 if (rest !== null) { | 282 if (rest !== null) { |
180 let names = Object.getOwnPropertyNames(rest); | 283 let names = Object.getOwnPropertyNames(rest); |
181 let entries = names.length; | 284 let entries = names.length; |
182 for (let i = 0; i < entries; i++) { | 285 for (let i = 0; i < entries; i++) { |
183 let key = names[i]; | 286 let key = names[i]; |
184 let bucket = rest[key]; | 287 let bucket = rest[key]; |
185 let length = bucket.length; | 288 let length = bucket.length; |
186 for (let i = 0; i < length; i = 2) { | 289 for (let i = 0; i < length; i = 2) { |
187 let key = bucket[i]; | 290 let key = bucket[i]; |
188 result[index] = key; | 291 result[index] = key; |
189 index++; | 292 index++; |
190 } | 293 } |
191 } | 294 } |
192 } | 295 } |
193 dart.assert(index === this._length); | 296 dart.assert(index === this[_length]); |
194 return this._keys = result; | 297 return this[_keys] = result; |
195 } | 298 } |
196 _addHashTableEntry(table, key, value) { | 299 [_addHashTableEntry](table, key, value) { |
197 if (!dart.notNull(_hasTableEntry(table, key))) { | 300 if (!dart.notNull(_hasTableEntry(table, key))) { |
198 this._length++; | 301 this[_length]++; |
199 this._keys = null; | 302 this[_keys] = null; |
200 } | 303 } |
201 _setTableEntry(table, key, value); | 304 _setTableEntry(table, key, value); |
202 } | 305 } |
203 _removeHashTableEntry(table, key) { | 306 [_removeHashTableEntry](table, key) { |
204 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, k
ey))) { | 307 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, k
ey))) { |
205 let value = dart.as(_getTableEntry(table, key), V); | 308 let value = dart.as(_getTableEntry(table, key), V); |
206 _deleteTableEntry(table, key); | 309 _deleteTableEntry(table, key); |
207 this._length--; | 310 this[_length]--; |
208 this._keys = null; | 311 this[_keys] = null; |
209 return value; | 312 return value; |
210 } else { | 313 } else { |
211 return dart.as(null, V); | 314 return dart.as(null, V); |
212 } | 315 } |
213 } | 316 } |
214 static _isStringKey(key) { | 317 static [_isStringKey](key) { |
215 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k
ey, '__proto__')); | 318 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k
ey, '__proto__')); |
216 } | 319 } |
217 static _isNumericKey(key) { | 320 static [_isNumericKey](key) { |
218 return dart.notNull(dart.is(key, core.num)) && dart.notNull((key & 0x3ff
ffff) === key); | 321 return dart.notNull(dart.is(key, core.num)) && dart.notNull((key & 0x3ff
ffff) === key); |
219 } | 322 } |
220 _computeHashCode(key) { | 323 [_computeHashCode](key) { |
221 return dart.dload(key, 'hashCode') & 0x3ffffff; | 324 return dart.dload(key, 'hashCode') & 0x3ffffff; |
222 } | 325 } |
223 static _hasTableEntry(table, key) { | 326 static [_hasTableEntry](table, key) { |
224 let entry = table[key]; | 327 let entry = table[key]; |
225 return entry !== null; | 328 return entry !== null; |
226 } | 329 } |
227 static _getTableEntry(table, key) { | 330 static [_getTableEntry](table, key) { |
228 let entry = table[key]; | 331 let entry = table[key]; |
229 return entry === table ? null : entry; | 332 return entry === table ? null : entry; |
230 } | 333 } |
231 static _setTableEntry(table, key, value) { | 334 static [_setTableEntry](table, key, value) { |
232 if (value === null) { | 335 if (value === null) { |
233 table[key] = table; | 336 table[key] = table; |
234 } else { | 337 } else { |
235 table[key] = value; | 338 table[key] = value; |
236 } | 339 } |
237 } | 340 } |
238 static _deleteTableEntry(table, key) { | 341 static [_deleteTableEntry](table, key) { |
239 delete table[key]; | 342 delete table[key]; |
240 } | 343 } |
241 _getBucket(table, key) { | 344 [_getBucket](table, key) { |
242 let hash = this._computeHashCode(key); | 345 let hash = this[_computeHashCode](key); |
243 return dart.as(table[hash], core.List); | 346 return dart.as(table[hash], core.List); |
244 } | 347 } |
245 _findBucketIndex(bucket, key) { | 348 [_findBucketIndex](bucket, key) { |
246 if (bucket === null) | 349 if (bucket === null) |
247 return -1; | 350 return -1; |
248 let length = bucket.length; | 351 let length = bucket.length; |
249 for (let i = 0; i < length; i = 2) { | 352 for (let i = 0; i < length; i = 2) { |
250 if (dart.equals(bucket[i], key)) | 353 if (dart.equals(bucket[i], key)) |
251 return i; | 354 return i; |
252 } | 355 } |
253 return -1; | 356 return -1; |
254 } | 357 } |
255 static _newHashTable() { | 358 static [_newHashTable]() { |
256 let table = Object.create(null); | 359 let table = Object.create(null); |
257 let temporaryKey = '<non-identifier-key>'; | 360 let temporaryKey = '<non-identifier-key>'; |
258 _setTableEntry(table, temporaryKey, table); | 361 _setTableEntry(table, temporaryKey, table); |
259 _deleteTableEntry(table, temporaryKey); | 362 _deleteTableEntry(table, temporaryKey); |
260 return table; | 363 return table; |
261 } | 364 } |
262 } | 365 } |
263 return _HashMap; | 366 return _HashMap; |
264 }); | 367 }); |
265 let _HashMap = _HashMap$(dynamic, dynamic); | 368 let _HashMap = _HashMap$(dynamic, dynamic); |
266 let _IdentityHashMap$ = dart.generic(function(K, V) { | 369 let _IdentityHashMap$ = dart.generic(function(K, V) { |
267 class _IdentityHashMap extends _HashMap$(K, V) { | 370 class _IdentityHashMap extends _HashMap$(K, V) { |
268 _computeHashCode(key) { | 371 [_computeHashCode](key) { |
269 return core.identityHashCode(key) & 0x3ffffff; | 372 return core.identityHashCode(key) & 0x3ffffff; |
270 } | 373 } |
271 _findBucketIndex(bucket, key) { | 374 [_findBucketIndex](bucket, key) { |
272 if (bucket === null) | 375 if (bucket === null) |
273 return -1; | 376 return -1; |
274 let length = bucket.length; | 377 let length = bucket.length; |
275 for (let i = 0; i < length; i = 2) { | 378 for (let i = 0; i < length; i = 2) { |
276 if (core.identical(bucket[i], key)) | 379 if (core.identical(bucket[i], key)) |
277 return i; | 380 return i; |
278 } | 381 } |
279 return -1; | 382 return -1; |
280 } | 383 } |
281 } | 384 } |
282 return _IdentityHashMap; | 385 return _IdentityHashMap; |
283 }); | 386 }); |
284 let _IdentityHashMap = _IdentityHashMap$(dynamic, dynamic); | 387 let _IdentityHashMap = _IdentityHashMap$(dynamic, dynamic); |
285 let _CustomHashMap$ = dart.generic(function(K, V) { | 388 let _CustomHashMap$ = dart.generic(function(K, V) { |
286 class _CustomHashMap extends _HashMap$(K, V) { | 389 class _CustomHashMap extends _HashMap$(K, V) { |
287 _CustomHashMap(_equals, _hashCode, validKey) { | 390 _CustomHashMap($_equals, $_hashCode, validKey) { |
288 this._equals = _equals; | 391 this[_equals] = $_equals; |
289 this._hashCode = _hashCode; | 392 this[_hashCode] = $_hashCode; |
290 this._validKey = dart.as(validKey !== null ? validKey : (v) => dart.is(v
, K), _Predicate); | 393 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is(
v, K), _Predicate); |
291 super._HashMap(); | 394 super._HashMap(); |
292 } | 395 } |
293 get(key) { | 396 get(key) { |
294 if (!dart.notNull(this._validKey(key))) | 397 if (!dart.notNull(this[_validKey](key))) |
295 return dart.as(null, V); | 398 return dart.as(null, V); |
296 return super._get(key); | 399 return super._get(key); |
297 } | 400 } |
298 set(key, value) { | 401 set(key, value) { |
299 super._set(key, value); | 402 super._set(key, value); |
300 } | 403 } |
301 containsKey(key) { | 404 containsKey(key) { |
302 if (!dart.notNull(this._validKey(key))) | 405 if (!dart.notNull(this[_validKey](key))) |
303 return false; | 406 return false; |
304 return super._containsKey(key); | 407 return super._containsKey(key); |
305 } | 408 } |
306 remove(key) { | 409 remove(key) { |
307 if (!dart.notNull(this._validKey(key))) | 410 if (!dart.notNull(this[_validKey](key))) |
308 return dart.as(null, V); | 411 return dart.as(null, V); |
309 return super._remove(key); | 412 return super._remove(key); |
310 } | 413 } |
311 _computeHashCode(key) { | 414 [_computeHashCode](key) { |
312 return this._hashCode(dart.as(key, K)) & 0x3ffffff; | 415 return this[_hashCode](dart.as(key, K)) & 0x3ffffff; |
313 } | 416 } |
314 _findBucketIndex(bucket, key) { | 417 [_findBucketIndex](bucket, key) { |
315 if (bucket === null) | 418 if (bucket === null) |
316 return -1; | 419 return -1; |
317 let length = bucket.length; | 420 let length = bucket.length; |
318 for (let i = 0; i < length; i = 2) { | 421 for (let i = 0; i < length; i = 2) { |
319 if (this._equals(dart.as(bucket[i], K), dart.as(key, K))) | 422 if (this[_equals](dart.as(bucket[i], K), dart.as(key, K))) |
320 return i; | 423 return i; |
321 } | 424 } |
322 return -1; | 425 return -1; |
323 } | 426 } |
324 toString() { | 427 toString() { |
325 return Maps.mapToString(this); | 428 return Maps.mapToString(this); |
326 } | 429 } |
327 } | 430 } |
328 return _CustomHashMap; | 431 return _CustomHashMap; |
329 }); | 432 }); |
330 let _CustomHashMap = _CustomHashMap$(dynamic, dynamic); | 433 let _CustomHashMap = _CustomHashMap$(dynamic, dynamic); |
331 let HashMapKeyIterable$ = dart.generic(function(E) { | 434 let HashMapKeyIterable$ = dart.generic(function(E) { |
332 class HashMapKeyIterable extends IterableBase$(E) { | 435 class HashMapKeyIterable extends IterableBase$(E) { |
333 HashMapKeyIterable(_map) { | 436 HashMapKeyIterable($_map) { |
334 this._map = _map; | 437 this[_map] = $_map; |
335 super.IterableBase(); | 438 super.IterableBase(); |
336 } | 439 } |
337 get length() { | 440 get length() { |
338 return dart.as(dart.dload(this._map, '_length'), core.int); | 441 return dart.as(dart.dload(this[_map], '_length'), core.int); |
339 } | 442 } |
340 get isEmpty() { | 443 get isEmpty() { |
341 return dart.equals(dart.dload(this._map, '_length'), 0); | 444 return dart.equals(dart.dload(this[_map], '_length'), 0); |
342 } | 445 } |
343 get iterator() { | 446 get iterator() { |
344 return new HashMapKeyIterator(this._map, dart.as(dart.dinvoke(this._map,
'_computeKeys'), core.List)); | 447 return new HashMapKeyIterator(this[_map], dart.as(dart.dinvoke(this[_map
], '_computeKeys'), core.List)); |
345 } | 448 } |
346 contains(element) { | 449 contains(element) { |
347 return dart.as(dart.dinvoke(this._map, 'containsKey', element), core.boo
l); | 450 return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bo
ol); |
348 } | 451 } |
349 forEach(f) { | 452 forEach(f) { |
350 let keys = dart.as(dart.dinvoke(this._map, '_computeKeys'), core.List); | 453 let keys = dart.as(dart.dinvoke(this[_map], '_computeKeys'), core.List); |
351 for (let i = 0, length = keys.length; i < length; i++) { | 454 for (let i = 0, length = keys.length; i < length; i++) { |
352 f(dart.as(keys[i], E)); | 455 f(dart.as(keys[i], E)); |
353 if (keys !== dart.dload(this._map, '_keys')) { | 456 if (keys !== dart.dload(this[_map], '_keys')) { |
354 throw new core.ConcurrentModificationError(this._map); | 457 throw new core.ConcurrentModificationError(this[_map]); |
355 } | 458 } |
356 } | 459 } |
357 } | 460 } |
358 } | 461 } |
359 return HashMapKeyIterable; | 462 return HashMapKeyIterable; |
360 }); | 463 }); |
361 let HashMapKeyIterable = HashMapKeyIterable$(dynamic); | 464 let HashMapKeyIterable = HashMapKeyIterable$(dynamic); |
362 let HashMapKeyIterator$ = dart.generic(function(E) { | 465 let HashMapKeyIterator$ = dart.generic(function(E) { |
363 class HashMapKeyIterator extends dart.Object { | 466 class HashMapKeyIterator extends dart.Object { |
364 HashMapKeyIterator(_map, _keys) { | 467 HashMapKeyIterator($_map, $_keys) { |
365 this._map = _map; | 468 this[_map] = $_map; |
366 this._keys = _keys; | 469 this[_keys] = $_keys; |
367 this._offset = 0; | 470 this[_offset] = 0; |
368 this._current = dart.as(null, E); | 471 this[_current] = dart.as(null, E); |
369 } | 472 } |
370 get current() { | 473 get current() { |
371 return this._current; | 474 return this[_current]; |
372 } | 475 } |
373 moveNext() { | 476 moveNext() { |
374 let keys = this._keys; | 477 let keys = this[_keys]; |
375 let offset = this._offset; | 478 let offset = this[_offset]; |
376 if (keys !== dart.dload(this._map, '_keys')) { | 479 if (keys !== dart.dload(this[_map], '_keys')) { |
377 throw new core.ConcurrentModificationError(this._map); | 480 throw new core.ConcurrentModificationError(this[_map]); |
378 } else if (offset >= keys.length) { | 481 } else if (offset >= keys.length) { |
379 this._current = dart.as(null, E); | 482 this[_current] = dart.as(null, E); |
380 return false; | 483 return false; |
381 } else { | 484 } else { |
382 this._current = dart.as(keys[offset], E); | 485 this[_current] = dart.as(keys[offset], E); |
383 this._offset = offset + 1; | 486 this[_offset] = offset + 1; |
384 return true; | 487 return true; |
385 } | 488 } |
386 } | 489 } |
387 } | 490 } |
388 return HashMapKeyIterator; | 491 return HashMapKeyIterator; |
389 }); | 492 }); |
390 let HashMapKeyIterator = HashMapKeyIterator$(dynamic); | 493 let HashMapKeyIterator = HashMapKeyIterator$(dynamic); |
391 let _LinkedHashMap$ = dart.generic(function(K, V) { | 494 let _LinkedHashMap$ = dart.generic(function(K, V) { |
392 class _LinkedHashMap extends dart.Object { | 495 class _LinkedHashMap extends dart.Object { |
393 _LinkedHashMap() { | 496 _LinkedHashMap() { |
394 this._length = 0; | 497 this[_length] = 0; |
395 this._strings = null; | 498 this[_strings] = null; |
396 this._nums = null; | 499 this[_nums] = null; |
397 this._rest = null; | 500 this[_rest] = null; |
398 this._first = null; | 501 this[_first] = null; |
399 this._last = null; | 502 this[_last] = null; |
400 this._modifications = 0; | 503 this[_modifications] = 0; |
401 } | 504 } |
402 get length() { | 505 get length() { |
403 return this._length; | 506 return this[_length]; |
404 } | 507 } |
405 get isEmpty() { | 508 get isEmpty() { |
406 return this._length === 0; | 509 return this[_length] === 0; |
407 } | 510 } |
408 get isNotEmpty() { | 511 get isNotEmpty() { |
409 return !dart.notNull(this.isEmpty); | 512 return !dart.notNull(this.isEmpty); |
410 } | 513 } |
411 get keys() { | 514 get keys() { |
412 return new LinkedHashMapKeyIterable(this); | 515 return new LinkedHashMapKeyIterable(this); |
413 } | 516 } |
414 get values() { | 517 get values() { |
415 return new _internal.MappedIterable(this.keys, ((each) => this.get(each)
).bind(this)); | 518 return new _internal.MappedIterable(this.keys, ((each) => this.get(each)
).bind(this)); |
416 } | 519 } |
417 containsKey(key) { | 520 containsKey(key) { |
418 if (_isStringKey(key)) { | 521 if (_isStringKey(key)) { |
419 let strings = this._strings; | 522 let strings = this[_strings]; |
420 if (strings === null) | 523 if (strings === null) |
421 return false; | 524 return false; |
422 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell); | 525 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell); |
423 return cell !== null; | 526 return cell !== null; |
424 } else if (_isNumericKey(key)) { | 527 } else if (_isNumericKey(key)) { |
425 let nums = this._nums; | 528 let nums = this[_nums]; |
426 if (nums === null) | 529 if (nums === null) |
427 return false; | 530 return false; |
428 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell); | 531 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell); |
429 return cell !== null; | 532 return cell !== null; |
430 } else { | 533 } else { |
431 return this._containsKey(key); | 534 return this[_containsKey](key); |
432 } | 535 } |
433 } | 536 } |
434 _containsKey(key) { | 537 [_containsKey](key) { |
435 let rest = this._rest; | 538 let rest = this[_rest]; |
436 if (rest === null) | 539 if (rest === null) |
437 return false; | 540 return false; |
438 let bucket = this._getBucket(rest, key); | 541 let bucket = this[_getBucket](rest, key); |
439 return this._findBucketIndex(bucket, key) >= 0; | 542 return this[_findBucketIndex](bucket, key) >= 0; |
440 } | 543 } |
441 containsValue(value) { | 544 containsValue(value) { |
442 return this.keys.any(((each) => dart.equals(this.get(each), value)).bind
(this)); | 545 return this.keys.any(((each) => dart.equals(this.get(each), value)).bind
(this)); |
443 } | 546 } |
444 addAll(other) { | 547 addAll(other) { |
445 other.forEach(((key, value) => { | 548 other.forEach(((key, value) => { |
446 this.set(key, value); | 549 this.set(key, value); |
447 }).bind(this)); | 550 }).bind(this)); |
448 } | 551 } |
449 get(key) { | 552 get(key) { |
450 if (_isStringKey(key)) { | 553 if (_isStringKey(key)) { |
451 let strings = this._strings; | 554 let strings = this[_strings]; |
452 if (strings === null) | 555 if (strings === null) |
453 return dart.as(null, V); | 556 return dart.as(null, V); |
454 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell); | 557 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell); |
455 return dart.as(cell === null ? null : cell._value, V); | 558 return dart.as(cell === null ? null : cell[_value], V); |
456 } else if (_isNumericKey(key)) { | 559 } else if (_isNumericKey(key)) { |
457 let nums = this._nums; | 560 let nums = this[_nums]; |
458 if (nums === null) | 561 if (nums === null) |
459 return dart.as(null, V); | 562 return dart.as(null, V); |
460 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell); | 563 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell); |
461 return dart.as(cell === null ? null : cell._value, V); | 564 return dart.as(cell === null ? null : cell[_value], V); |
462 } else { | 565 } else { |
463 return this._get(key); | 566 return this[_get](key); |
464 } | 567 } |
465 } | 568 } |
466 _get(key) { | 569 [_get](key) { |
467 let rest = this._rest; | 570 let rest = this[_rest]; |
468 if (rest === null) | 571 if (rest === null) |
469 return dart.as(null, V); | 572 return dart.as(null, V); |
470 let bucket = this._getBucket(rest, key); | 573 let bucket = this[_getBucket](rest, key); |
471 let index = this._findBucketIndex(bucket, key); | 574 let index = this[_findBucketIndex](bucket, key); |
472 if (index < 0) | 575 if (index < 0) |
473 return dart.as(null, V); | 576 return dart.as(null, V); |
474 let cell = dart.as(bucket[index], LinkedHashMapCell); | 577 let cell = dart.as(bucket[index], LinkedHashMapCell); |
475 return dart.as(cell._value, V); | 578 return dart.as(cell[_value], V); |
476 } | 579 } |
477 set(key, value) { | 580 set(key, value) { |
478 if (_isStringKey(key)) { | 581 if (_isStringKey(key)) { |
479 let strings = this._strings; | 582 let strings = this[_strings]; |
480 if (strings === null) | 583 if (strings === null) |
481 this._strings = strings = _newHashTable(); | 584 this[_strings] = strings = _newHashTable(); |
482 this._addHashTableEntry(strings, key, value); | 585 this[_addHashTableEntry](strings, key, value); |
483 } else if (_isNumericKey(key)) { | 586 } else if (_isNumericKey(key)) { |
484 let nums = this._nums; | 587 let nums = this[_nums]; |
485 if (nums === null) | 588 if (nums === null) |
486 this._nums = nums = _newHashTable(); | 589 this[_nums] = nums = _newHashTable(); |
487 this._addHashTableEntry(nums, key, value); | 590 this[_addHashTableEntry](nums, key, value); |
488 } else { | 591 } else { |
489 this._set(key, value); | 592 this[_set](key, value); |
490 } | 593 } |
491 } | 594 } |
492 _set(key, value) { | 595 [_set](key, value) { |
493 let rest = this._rest; | 596 let rest = this[_rest]; |
494 if (rest === null) | 597 if (rest === null) |
495 this._rest = rest = _newHashTable(); | 598 this[_rest] = rest = _newHashTable(); |
496 let hash = this._computeHashCode(key); | 599 let hash = this[_computeHashCode](key); |
497 let bucket = rest[hash]; | 600 let bucket = rest[hash]; |
498 if (bucket === null) { | 601 if (bucket === null) { |
499 let cell = this._newLinkedCell(key, value); | 602 let cell = this[_newLinkedCell](key, value); |
500 _setTableEntry(rest, hash, [cell]); | 603 _setTableEntry(rest, hash, [cell]); |
501 } else { | 604 } else { |
502 let index = this._findBucketIndex(bucket, key); | 605 let index = this[_findBucketIndex](bucket, key); |
503 if (index >= 0) { | 606 if (index >= 0) { |
504 let cell = dart.as(bucket[index], LinkedHashMapCell); | 607 let cell = dart.as(bucket[index], LinkedHashMapCell); |
505 cell._value = value; | 608 cell[_value] = value; |
506 } else { | 609 } else { |
507 let cell = this._newLinkedCell(key, value); | 610 let cell = this[_newLinkedCell](key, value); |
508 bucket.push(cell); | 611 bucket.push(cell); |
509 } | 612 } |
510 } | 613 } |
511 } | 614 } |
512 putIfAbsent(key, ifAbsent) { | 615 putIfAbsent(key, ifAbsent) { |
513 if (this.containsKey(key)) | 616 if (this.containsKey(key)) |
514 return this.get(key); | 617 return this.get(key); |
515 let value = ifAbsent(); | 618 let value = ifAbsent(); |
516 this.set(key, value); | 619 this.set(key, value); |
517 return value; | 620 return value; |
518 } | 621 } |
519 remove(key) { | 622 remove(key) { |
520 if (_isStringKey(key)) { | 623 if (_isStringKey(key)) { |
521 return this._removeHashTableEntry(this._strings, key); | 624 return this[_removeHashTableEntry](this[_strings], key); |
522 } else if (_isNumericKey(key)) { | 625 } else if (_isNumericKey(key)) { |
523 return this._removeHashTableEntry(this._nums, key); | 626 return this[_removeHashTableEntry](this[_nums], key); |
524 } else { | 627 } else { |
525 return this._remove(key); | 628 return this[_remove](key); |
526 } | 629 } |
527 } | 630 } |
528 _remove(key) { | 631 [_remove](key) { |
529 let rest = this._rest; | 632 let rest = this[_rest]; |
530 if (rest === null) | 633 if (rest === null) |
531 return dart.as(null, V); | 634 return dart.as(null, V); |
532 let bucket = this._getBucket(rest, key); | 635 let bucket = this[_getBucket](rest, key); |
533 let index = this._findBucketIndex(bucket, key); | 636 let index = this[_findBucketIndex](bucket, key); |
534 if (index < 0) | 637 if (index < 0) |
535 return dart.as(null, V); | 638 return dart.as(null, V); |
536 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashMapCell); | 639 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashMapCell); |
537 this._unlinkCell(cell); | 640 this[_unlinkCell](cell); |
538 return dart.as(cell._value, V); | 641 return dart.as(cell[_value], V); |
539 } | 642 } |
540 clear() { | 643 clear() { |
541 if (this._length > 0) { | 644 if (this[_length] > 0) { |
542 this._strings = this._nums = this._rest = this._first = this._last = n
ull; | 645 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last
] = null; |
543 this._length = 0; | 646 this[_length] = 0; |
544 this._modified(); | 647 this[_modified](); |
545 } | 648 } |
546 } | 649 } |
547 forEach(action) { | 650 forEach(action) { |
548 let cell = this._first; | 651 let cell = this[_first]; |
549 let modifications = this._modifications; | 652 let modifications = this[_modifications]; |
550 while (cell !== null) { | 653 while (cell !== null) { |
551 action(dart.as(cell._key, K), dart.as(cell._value, V)); | 654 action(dart.as(cell[_key], K), dart.as(cell[_value], V)); |
552 if (modifications !== this._modifications) { | 655 if (modifications !== this[_modifications]) { |
553 throw new core.ConcurrentModificationError(this); | 656 throw new core.ConcurrentModificationError(this); |
554 } | 657 } |
555 cell = cell._next; | 658 cell = cell[_next]; |
556 } | 659 } |
557 } | 660 } |
558 _addHashTableEntry(table, key, value) { | 661 [_addHashTableEntry](table, key, value) { |
559 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); | 662 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); |
560 if (cell === null) { | 663 if (cell === null) { |
561 _setTableEntry(table, key, this._newLinkedCell(key, value)); | 664 _setTableEntry(table, key, this[_newLinkedCell](key, value)); |
562 } else { | 665 } else { |
563 cell._value = value; | 666 cell[_value] = value; |
564 } | 667 } |
565 } | 668 } |
566 _removeHashTableEntry(table, key) { | 669 [_removeHashTableEntry](table, key) { |
567 if (table === null) | 670 if (table === null) |
568 return dart.as(null, V); | 671 return dart.as(null, V); |
569 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); | 672 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); |
570 if (cell === null) | 673 if (cell === null) |
571 return dart.as(null, V); | 674 return dart.as(null, V); |
572 this._unlinkCell(cell); | 675 this[_unlinkCell](cell); |
573 _deleteTableEntry(table, key); | 676 _deleteTableEntry(table, key); |
574 return dart.as(cell._value, V); | 677 return dart.as(cell[_value], V); |
575 } | 678 } |
576 _modified() { | 679 [_modified]() { |
577 this._modifications = this._modifications + 1 & 67108863; | 680 this[_modifications] = this[_modifications] + 1 & 67108863; |
578 } | 681 } |
579 _newLinkedCell(key, value) { | 682 [_newLinkedCell](key, value) { |
580 let cell = new LinkedHashMapCell(key, value); | 683 let cell = new LinkedHashMapCell(key, value); |
581 if (this._first === null) { | 684 if (this[_first] === null) { |
582 this._first = this._last = cell; | 685 this[_first] = this[_last] = cell; |
583 } else { | 686 } else { |
584 let last = this._last; | 687 let last = this[_last]; |
585 cell._previous = last; | 688 cell[_previous] = last; |
586 this._last = last._next = cell; | 689 this[_last] = last[_next] = cell; |
587 } | 690 } |
588 this._length++; | 691 this[_length]++; |
589 this._modified(); | 692 this[_modified](); |
590 return cell; | 693 return cell; |
591 } | 694 } |
592 _unlinkCell(cell) { | 695 [_unlinkCell](cell) { |
593 let previous = cell._previous; | 696 let previous = cell[_previous]; |
594 let next = cell._next; | 697 let next = cell[_next]; |
595 if (previous === null) { | 698 if (previous === null) { |
596 dart.assert(dart.equals(cell, this._first)); | 699 dart.assert(dart.equals(cell, this[_first])); |
597 this._first = next; | 700 this[_first] = next; |
598 } else { | 701 } else { |
599 previous._next = next; | 702 previous[_next] = next; |
600 } | 703 } |
601 if (next === null) { | 704 if (next === null) { |
602 dart.assert(dart.equals(cell, this._last)); | 705 dart.assert(dart.equals(cell, this[_last])); |
603 this._last = previous; | 706 this[_last] = previous; |
604 } else { | 707 } else { |
605 next._previous = previous; | 708 next[_previous] = previous; |
606 } | 709 } |
607 this._length--; | 710 this[_length]--; |
608 this._modified(); | 711 this[_modified](); |
609 } | 712 } |
610 static _isStringKey(key) { | 713 static [_isStringKey](key) { |
611 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k
ey, '__proto__')); | 714 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k
ey, '__proto__')); |
612 } | 715 } |
613 static _isNumericKey(key) { | 716 static [_isNumericKey](key) { |
614 return dart.notNull(dart.is(key, core.num)) && dart.notNull((key & 0x3ff
ffff) === key); | 717 return dart.notNull(dart.is(key, core.num)) && dart.notNull((key & 0x3ff
ffff) === key); |
615 } | 718 } |
616 _computeHashCode(key) { | 719 [_computeHashCode](key) { |
617 return dart.dload(key, 'hashCode') & 0x3ffffff; | 720 return dart.dload(key, 'hashCode') & 0x3ffffff; |
618 } | 721 } |
619 static _getTableEntry(table, key) { | 722 static [_getTableEntry](table, key) { |
620 return table[key]; | 723 return table[key]; |
621 } | 724 } |
622 static _setTableEntry(table, key, value) { | 725 static [_setTableEntry](table, key, value) { |
623 dart.assert(value !== null); | 726 dart.assert(value !== null); |
624 table[key] = value; | 727 table[key] = value; |
625 } | 728 } |
626 static _deleteTableEntry(table, key) { | 729 static [_deleteTableEntry](table, key) { |
627 delete table[key]; | 730 delete table[key]; |
628 } | 731 } |
629 _getBucket(table, key) { | 732 [_getBucket](table, key) { |
630 let hash = this._computeHashCode(key); | 733 let hash = this[_computeHashCode](key); |
631 return dart.as(table[hash], core.List); | 734 return dart.as(table[hash], core.List); |
632 } | 735 } |
633 _findBucketIndex(bucket, key) { | 736 [_findBucketIndex](bucket, key) { |
634 if (bucket === null) | 737 if (bucket === null) |
635 return -1; | 738 return -1; |
636 let length = bucket.length; | 739 let length = bucket.length; |
637 for (let i = 0; i < length; i++) { | 740 for (let i = 0; i < length; i++) { |
638 let cell = dart.as(bucket[i], LinkedHashMapCell); | 741 let cell = dart.as(bucket[i], LinkedHashMapCell); |
639 if (dart.equals(cell._key, key)) | 742 if (dart.equals(cell[_key], key)) |
640 return i; | 743 return i; |
641 } | 744 } |
642 return -1; | 745 return -1; |
643 } | 746 } |
644 static _newHashTable() { | 747 static [_newHashTable]() { |
645 let table = Object.create(null); | 748 let table = Object.create(null); |
646 let temporaryKey = '<non-identifier-key>'; | 749 let temporaryKey = '<non-identifier-key>'; |
647 _setTableEntry(table, temporaryKey, table); | 750 _setTableEntry(table, temporaryKey, table); |
648 _deleteTableEntry(table, temporaryKey); | 751 _deleteTableEntry(table, temporaryKey); |
649 return table; | 752 return table; |
650 } | 753 } |
651 toString() { | 754 toString() { |
652 return Maps.mapToString(this); | 755 return Maps.mapToString(this); |
653 } | 756 } |
654 } | 757 } |
655 return _LinkedHashMap; | 758 return _LinkedHashMap; |
656 }); | 759 }); |
657 let _LinkedHashMap = _LinkedHashMap$(dynamic, dynamic); | 760 let _LinkedHashMap = _LinkedHashMap$(dynamic, dynamic); |
658 let _LinkedIdentityHashMap$ = dart.generic(function(K, V) { | 761 let _LinkedIdentityHashMap$ = dart.generic(function(K, V) { |
659 class _LinkedIdentityHashMap extends _LinkedHashMap$(K, V) { | 762 class _LinkedIdentityHashMap extends _LinkedHashMap$(K, V) { |
660 _computeHashCode(key) { | 763 [_computeHashCode](key) { |
661 return core.identityHashCode(key) & 0x3ffffff; | 764 return core.identityHashCode(key) & 0x3ffffff; |
662 } | 765 } |
663 _findBucketIndex(bucket, key) { | 766 [_findBucketIndex](bucket, key) { |
664 if (bucket === null) | 767 if (bucket === null) |
665 return -1; | 768 return -1; |
666 let length = bucket.length; | 769 let length = bucket.length; |
667 for (let i = 0; i < length; i++) { | 770 for (let i = 0; i < length; i++) { |
668 let cell = dart.as(bucket[i], LinkedHashMapCell); | 771 let cell = dart.as(bucket[i], LinkedHashMapCell); |
669 if (core.identical(cell._key, key)) | 772 if (core.identical(cell[_key], key)) |
670 return i; | 773 return i; |
671 } | 774 } |
672 return -1; | 775 return -1; |
673 } | 776 } |
674 } | 777 } |
675 return _LinkedIdentityHashMap; | 778 return _LinkedIdentityHashMap; |
676 }); | 779 }); |
677 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$(dynamic, dynamic); | 780 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$(dynamic, dynamic); |
678 let _LinkedCustomHashMap$ = dart.generic(function(K, V) { | 781 let _LinkedCustomHashMap$ = dart.generic(function(K, V) { |
679 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) { | 782 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) { |
680 _LinkedCustomHashMap(_equals, _hashCode, validKey) { | 783 _LinkedCustomHashMap($_equals, $_hashCode, validKey) { |
681 this._equals = _equals; | 784 this[_equals] = $_equals; |
682 this._hashCode = _hashCode; | 785 this[_hashCode] = $_hashCode; |
683 this._validKey = dart.as(validKey !== null ? validKey : (v) => dart.is(v
, K), _Predicate); | 786 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is(
v, K), _Predicate); |
684 super._LinkedHashMap(); | 787 super._LinkedHashMap(); |
685 } | 788 } |
686 get(key) { | 789 get(key) { |
687 if (!dart.notNull(this._validKey(key))) | 790 if (!dart.notNull(this[_validKey](key))) |
688 return dart.as(null, V); | 791 return dart.as(null, V); |
689 return super._get(key); | 792 return super._get(key); |
690 } | 793 } |
691 set(key, value) { | 794 set(key, value) { |
692 super._set(key, value); | 795 super._set(key, value); |
693 } | 796 } |
694 containsKey(key) { | 797 containsKey(key) { |
695 if (!dart.notNull(this._validKey(key))) | 798 if (!dart.notNull(this[_validKey](key))) |
696 return false; | 799 return false; |
697 return super._containsKey(key); | 800 return super._containsKey(key); |
698 } | 801 } |
699 remove(key) { | 802 remove(key) { |
700 if (!dart.notNull(this._validKey(key))) | 803 if (!dart.notNull(this[_validKey](key))) |
701 return dart.as(null, V); | 804 return dart.as(null, V); |
702 return super._remove(key); | 805 return super._remove(key); |
703 } | 806 } |
704 _computeHashCode(key) { | 807 [_computeHashCode](key) { |
705 return this._hashCode(dart.as(key, K)) & 0x3ffffff; | 808 return this[_hashCode](dart.as(key, K)) & 0x3ffffff; |
706 } | 809 } |
707 _findBucketIndex(bucket, key) { | 810 [_findBucketIndex](bucket, key) { |
708 if (bucket === null) | 811 if (bucket === null) |
709 return -1; | 812 return -1; |
710 let length = bucket.length; | 813 let length = bucket.length; |
711 for (let i = 0; i < length; i++) { | 814 for (let i = 0; i < length; i++) { |
712 let cell = dart.as(bucket[i], LinkedHashMapCell); | 815 let cell = dart.as(bucket[i], LinkedHashMapCell); |
713 if (this._equals(dart.as(cell._key, K), dart.as(key, K))) | 816 if (this[_equals](dart.as(cell[_key], K), dart.as(key, K))) |
714 return i; | 817 return i; |
715 } | 818 } |
716 return -1; | 819 return -1; |
717 } | 820 } |
718 } | 821 } |
719 return _LinkedCustomHashMap; | 822 return _LinkedCustomHashMap; |
720 }); | 823 }); |
721 let _LinkedCustomHashMap = _LinkedCustomHashMap$(dynamic, dynamic); | 824 let _LinkedCustomHashMap = _LinkedCustomHashMap$(dynamic, dynamic); |
722 class LinkedHashMapCell extends dart.Object { | 825 class LinkedHashMapCell extends dart.Object { |
723 LinkedHashMapCell(_key, _value) { | 826 LinkedHashMapCell($_key, $_value) { |
724 this._key = _key; | 827 this[_key] = $_key; |
725 this._value = _value; | 828 this[_value] = $_value; |
726 this._next = null; | 829 this[_next] = null; |
727 this._previous = null; | 830 this[_previous] = null; |
728 } | 831 } |
729 } | 832 } |
730 let LinkedHashMapKeyIterable$ = dart.generic(function(E) { | 833 let LinkedHashMapKeyIterable$ = dart.generic(function(E) { |
731 class LinkedHashMapKeyIterable extends IterableBase$(E) { | 834 class LinkedHashMapKeyIterable extends IterableBase$(E) { |
732 LinkedHashMapKeyIterable(_map) { | 835 LinkedHashMapKeyIterable($_map) { |
733 this._map = _map; | 836 this[_map] = $_map; |
734 super.IterableBase(); | 837 super.IterableBase(); |
735 } | 838 } |
736 get length() { | 839 get length() { |
737 return dart.as(dart.dload(this._map, '_length'), core.int); | 840 return dart.as(dart.dload(this[_map], '_length'), core.int); |
738 } | 841 } |
739 get isEmpty() { | 842 get isEmpty() { |
740 return dart.equals(dart.dload(this._map, '_length'), 0); | 843 return dart.equals(dart.dload(this[_map], '_length'), 0); |
741 } | 844 } |
742 get iterator() { | 845 get iterator() { |
743 return new LinkedHashMapKeyIterator(this._map, dart.as(dart.dload(this._
map, '_modifications'), core.int)); | 846 return new LinkedHashMapKeyIterator(this[_map], dart.as(dart.dload(this[
_map], '_modifications'), core.int)); |
744 } | 847 } |
745 contains(element) { | 848 contains(element) { |
746 return dart.as(dart.dinvoke(this._map, 'containsKey', element), core.boo
l); | 849 return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bo
ol); |
747 } | 850 } |
748 forEach(f) { | 851 forEach(f) { |
749 let cell = dart.as(dart.dload(this._map, '_first'), LinkedHashMapCell); | 852 let cell = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCell); |
750 let modifications = dart.as(dart.dload(this._map, '_modifications'), cor
e.int); | 853 let modifications = dart.as(dart.dload(this[_map], '_modifications'), co
re.int); |
751 while (cell !== null) { | 854 while (cell !== null) { |
752 f(dart.as(cell._key, E)); | 855 f(dart.as(cell[_key], E)); |
753 if (modifications !== dart.dload(this._map, '_modifications')) { | 856 if (modifications !== dart.dload(this[_map], '_modifications')) { |
754 throw new core.ConcurrentModificationError(this._map); | 857 throw new core.ConcurrentModificationError(this[_map]); |
755 } | 858 } |
756 cell = cell._next; | 859 cell = cell[_next]; |
757 } | 860 } |
758 } | 861 } |
759 } | 862 } |
760 return LinkedHashMapKeyIterable; | 863 return LinkedHashMapKeyIterable; |
761 }); | 864 }); |
762 let LinkedHashMapKeyIterable = LinkedHashMapKeyIterable$(dynamic); | 865 let LinkedHashMapKeyIterable = LinkedHashMapKeyIterable$(dynamic); |
763 let LinkedHashMapKeyIterator$ = dart.generic(function(E) { | 866 let LinkedHashMapKeyIterator$ = dart.generic(function(E) { |
764 class LinkedHashMapKeyIterator extends dart.Object { | 867 class LinkedHashMapKeyIterator extends dart.Object { |
765 LinkedHashMapKeyIterator(_map, _modifications) { | 868 LinkedHashMapKeyIterator($_map, $_modifications) { |
766 this._map = _map; | 869 this[_map] = $_map; |
767 this._modifications = _modifications; | 870 this[_modifications] = $_modifications; |
768 this._cell = null; | 871 this[_cell] = null; |
769 this._current = dart.as(null, E); | 872 this[_current] = dart.as(null, E); |
770 this._cell = dart.as(dart.dload(this._map, '_first'), LinkedHashMapCell)
; | 873 this[_cell] = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCel
l); |
771 } | 874 } |
772 get current() { | 875 get current() { |
773 return this._current; | 876 return this[_current]; |
774 } | 877 } |
775 moveNext() { | 878 moveNext() { |
776 if (this._modifications !== dart.dload(this._map, '_modifications')) { | 879 if (this[_modifications] !== dart.dload(this[_map], '_modifications')) { |
777 throw new core.ConcurrentModificationError(this._map); | 880 throw new core.ConcurrentModificationError(this[_map]); |
778 } else if (this._cell === null) { | 881 } else if (this[_cell] === null) { |
779 this._current = dart.as(null, E); | 882 this[_current] = dart.as(null, E); |
780 return false; | 883 return false; |
781 } else { | 884 } else { |
782 this._current = dart.as(this._cell._key, E); | 885 this[_current] = dart.as(this[_cell][_key], E); |
783 this._cell = this._cell._next; | 886 this[_cell] = this[_cell][_next]; |
784 return true; | 887 return true; |
785 } | 888 } |
786 } | 889 } |
787 } | 890 } |
788 return LinkedHashMapKeyIterator; | 891 return LinkedHashMapKeyIterator; |
789 }); | 892 }); |
790 let LinkedHashMapKeyIterator = LinkedHashMapKeyIterator$(dynamic); | 893 let LinkedHashMapKeyIterator = LinkedHashMapKeyIterator$(dynamic); |
791 let _HashSet$ = dart.generic(function(E) { | 894 let _HashSet$ = dart.generic(function(E) { |
792 class _HashSet extends _HashSetBase$(E) { | 895 class _HashSet extends _HashSetBase$(E) { |
793 _HashSet() { | 896 _HashSet() { |
794 this._length = 0; | 897 this[_length] = 0; |
795 this._strings = null; | 898 this[_strings] = null; |
796 this._nums = null; | 899 this[_nums] = null; |
797 this._rest = null; | 900 this[_rest] = null; |
798 this._elements = null; | 901 this[_elements] = null; |
799 super._HashSetBase(); | 902 super._HashSetBase(); |
800 } | 903 } |
801 _newSet() { | 904 [_newSet]() { |
802 return new _HashSet(); | 905 return new _HashSet(); |
803 } | 906 } |
804 get iterator() { | 907 get iterator() { |
805 return new HashSetIterator(this, this._computeElements()); | 908 return new HashSetIterator(this, this[_computeElements]()); |
806 } | 909 } |
807 get length() { | 910 get length() { |
808 return this._length; | 911 return this[_length]; |
809 } | 912 } |
810 get isEmpty() { | 913 get isEmpty() { |
811 return this._length === 0; | 914 return this[_length] === 0; |
812 } | 915 } |
813 get isNotEmpty() { | 916 get isNotEmpty() { |
814 return !dart.notNull(this.isEmpty); | 917 return !dart.notNull(this.isEmpty); |
815 } | 918 } |
816 contains(object) { | 919 contains(object) { |
817 if (_isStringElement(object)) { | 920 if (_isStringElement(object)) { |
818 let strings = this._strings; | 921 let strings = this[_strings]; |
819 return strings === null ? false : _hasTableEntry(strings, object); | 922 return strings === null ? false : _hasTableEntry(strings, object); |
820 } else if (_isNumericElement(object)) { | 923 } else if (_isNumericElement(object)) { |
821 let nums = this._nums; | 924 let nums = this[_nums]; |
822 return nums === null ? false : _hasTableEntry(nums, object); | 925 return nums === null ? false : _hasTableEntry(nums, object); |
823 } else { | 926 } else { |
824 return this._contains(object); | 927 return this[_contains](object); |
825 } | 928 } |
826 } | 929 } |
827 _contains(object) { | 930 [_contains](object) { |
828 let rest = this._rest; | 931 let rest = this[_rest]; |
829 if (rest === null) | 932 if (rest === null) |
830 return false; | 933 return false; |
831 let bucket = this._getBucket(rest, object); | 934 let bucket = this[_getBucket](rest, object); |
832 return this._findBucketIndex(bucket, object) >= 0; | 935 return this[_findBucketIndex](bucket, object) >= 0; |
833 } | 936 } |
834 lookup(object) { | 937 lookup(object) { |
835 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle
ment(object))) { | 938 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle
ment(object))) { |
836 return dart.as(this.contains(object) ? object : null, E); | 939 return dart.as(this.contains(object) ? object : null, E); |
837 } | 940 } |
838 return this._lookup(object); | 941 return this[_lookup](object); |
839 } | 942 } |
840 _lookup(object) { | 943 [_lookup](object) { |
841 let rest = this._rest; | 944 let rest = this[_rest]; |
842 if (rest === null) | 945 if (rest === null) |
843 return dart.as(null, E); | 946 return dart.as(null, E); |
844 let bucket = this._getBucket(rest, object); | 947 let bucket = this[_getBucket](rest, object); |
845 let index = this._findBucketIndex(bucket, object); | 948 let index = this[_findBucketIndex](bucket, object); |
846 if (index < 0) | 949 if (index < 0) |
847 return dart.as(null, E); | 950 return dart.as(null, E); |
848 return dart.as(bucket.get(index), E); | 951 return dart.as(bucket.get(index), E); |
849 } | 952 } |
850 add(element) { | 953 add(element) { |
851 if (_isStringElement(element)) { | 954 if (_isStringElement(element)) { |
852 let strings = this._strings; | 955 let strings = this[_strings]; |
853 if (strings === null) | 956 if (strings === null) |
854 this._strings = strings = _newHashTable(); | 957 this[_strings] = strings = _newHashTable(); |
855 return this._addHashTableEntry(strings, element); | 958 return this[_addHashTableEntry](strings, element); |
856 } else if (_isNumericElement(element)) { | 959 } else if (_isNumericElement(element)) { |
857 let nums = this._nums; | 960 let nums = this[_nums]; |
858 if (nums === null) | 961 if (nums === null) |
859 this._nums = nums = _newHashTable(); | 962 this[_nums] = nums = _newHashTable(); |
860 return this._addHashTableEntry(nums, element); | 963 return this[_addHashTableEntry](nums, element); |
861 } else { | 964 } else { |
862 return this._add(element); | 965 return this[_add](element); |
863 } | 966 } |
864 } | 967 } |
865 _add(element) { | 968 [_add](element) { |
866 let rest = this._rest; | 969 let rest = this[_rest]; |
867 if (rest === null) | 970 if (rest === null) |
868 this._rest = rest = _newHashTable(); | 971 this[_rest] = rest = _newHashTable(); |
869 let hash = this._computeHashCode(element); | 972 let hash = this[_computeHashCode](element); |
870 let bucket = rest[hash]; | 973 let bucket = rest[hash]; |
871 if (bucket === null) { | 974 if (bucket === null) { |
872 _setTableEntry(rest, hash, [element]); | 975 _setTableEntry(rest, hash, [element]); |
873 } else { | 976 } else { |
874 let index = this._findBucketIndex(bucket, element); | 977 let index = this[_findBucketIndex](bucket, element); |
875 if (index >= 0) | 978 if (index >= 0) |
876 return false; | 979 return false; |
877 bucket.push(element); | 980 bucket.push(element); |
878 } | 981 } |
879 this._length++; | 982 this[_length]++; |
880 this._elements = null; | 983 this[_elements] = null; |
881 return true; | 984 return true; |
882 } | 985 } |
883 addAll(objects) { | 986 addAll(objects) { |
884 for (let each of objects) { | 987 for (let each of objects) { |
885 this.add(each); | 988 this.add(each); |
886 } | 989 } |
887 } | 990 } |
888 remove(object) { | 991 remove(object) { |
889 if (_isStringElement(object)) { | 992 if (_isStringElement(object)) { |
890 return this._removeHashTableEntry(this._strings, object); | 993 return this[_removeHashTableEntry](this[_strings], object); |
891 } else if (_isNumericElement(object)) { | 994 } else if (_isNumericElement(object)) { |
892 return this._removeHashTableEntry(this._nums, object); | 995 return this[_removeHashTableEntry](this[_nums], object); |
893 } else { | 996 } else { |
894 return this._remove(object); | 997 return this[_remove](object); |
895 } | 998 } |
896 } | 999 } |
897 _remove(object) { | 1000 [_remove](object) { |
898 let rest = this._rest; | 1001 let rest = this[_rest]; |
899 if (rest === null) | 1002 if (rest === null) |
900 return false; | 1003 return false; |
901 let bucket = this._getBucket(rest, object); | 1004 let bucket = this[_getBucket](rest, object); |
902 let index = this._findBucketIndex(bucket, object); | 1005 let index = this[_findBucketIndex](bucket, object); |
903 if (index < 0) | 1006 if (index < 0) |
904 return false; | 1007 return false; |
905 this._length--; | 1008 this[_length]--; |
906 this._elements = null; | 1009 this[_elements] = null; |
907 bucket.splice(index, 1); | 1010 bucket.splice(index, 1); |
908 return true; | 1011 return true; |
909 } | 1012 } |
910 clear() { | 1013 clear() { |
911 if (this._length > 0) { | 1014 if (this[_length] > 0) { |
912 this._strings = this._nums = this._rest = this._elements = null; | 1015 this[_strings] = this[_nums] = this[_rest] = this[_elements] = null; |
913 this._length = 0; | 1016 this[_length] = 0; |
914 } | 1017 } |
915 } | 1018 } |
916 _computeElements() { | 1019 [_computeElements]() { |
917 if (this._elements !== null) | 1020 if (this[_elements] !== null) |
918 return this._elements; | 1021 return this[_elements]; |
919 let result = new core.List(this._length); | 1022 let result = new core.List(this[_length]); |
920 let index = 0; | 1023 let index = 0; |
921 let strings = this._strings; | 1024 let strings = this[_strings]; |
922 if (strings !== null) { | 1025 if (strings !== null) { |
923 let names = Object.getOwnPropertyNames(strings); | 1026 let names = Object.getOwnPropertyNames(strings); |
924 let entries = names.length; | 1027 let entries = names.length; |
925 for (let i = 0; i < entries; i++) { | 1028 for (let i = 0; i < entries; i++) { |
926 let element = names[i]; | 1029 let element = names[i]; |
927 result[index] = element; | 1030 result[index] = element; |
928 index++; | 1031 index++; |
929 } | 1032 } |
930 } | 1033 } |
931 let nums = this._nums; | 1034 let nums = this[_nums]; |
932 if (nums !== null) { | 1035 if (nums !== null) { |
933 let names = Object.getOwnPropertyNames(nums); | 1036 let names = Object.getOwnPropertyNames(nums); |
934 let entries = names.length; | 1037 let entries = names.length; |
935 for (let i = 0; i < entries; i++) { | 1038 for (let i = 0; i < entries; i++) { |
936 let element = +names[i]; | 1039 let element = +names[i]; |
937 result[index] = element; | 1040 result[index] = element; |
938 index++; | 1041 index++; |
939 } | 1042 } |
940 } | 1043 } |
941 let rest = this._rest; | 1044 let rest = this[_rest]; |
942 if (rest !== null) { | 1045 if (rest !== null) { |
943 let names = Object.getOwnPropertyNames(rest); | 1046 let names = Object.getOwnPropertyNames(rest); |
944 let entries = names.length; | 1047 let entries = names.length; |
945 for (let i = 0; i < entries; i++) { | 1048 for (let i = 0; i < entries; i++) { |
946 let entry = names[i]; | 1049 let entry = names[i]; |
947 let bucket = rest[entry]; | 1050 let bucket = rest[entry]; |
948 let length = bucket.length; | 1051 let length = bucket.length; |
949 for (let i = 0; i < length; i++) { | 1052 for (let i = 0; i < length; i++) { |
950 result[index] = bucket[i]; | 1053 result[index] = bucket[i]; |
951 index++; | 1054 index++; |
952 } | 1055 } |
953 } | 1056 } |
954 } | 1057 } |
955 dart.assert(index === this._length); | 1058 dart.assert(index === this[_length]); |
956 return this._elements = result; | 1059 return this[_elements] = result; |
957 } | 1060 } |
958 _addHashTableEntry(table, element) { | 1061 [_addHashTableEntry](table, element) { |
959 if (_hasTableEntry(table, element)) | 1062 if (_hasTableEntry(table, element)) |
960 return false; | 1063 return false; |
961 _setTableEntry(table, element, 0); | 1064 _setTableEntry(table, element, 0); |
962 this._length++; | 1065 this[_length]++; |
963 this._elements = null; | 1066 this[_elements] = null; |
964 return true; | 1067 return true; |
965 } | 1068 } |
966 _removeHashTableEntry(table, element) { | 1069 [_removeHashTableEntry](table, element) { |
967 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, e
lement))) { | 1070 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, e
lement))) { |
968 _deleteTableEntry(table, element); | 1071 _deleteTableEntry(table, element); |
969 this._length--; | 1072 this[_length]--; |
970 this._elements = null; | 1073 this[_elements] = null; |
971 return true; | 1074 return true; |
972 } else { | 1075 } else { |
973 return false; | 1076 return false; |
974 } | 1077 } |
975 } | 1078 } |
976 static _isStringElement(element) { | 1079 static [_isStringElement](element) { |
977 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa
ls(element, '__proto__')); | 1080 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa
ls(element, '__proto__')); |
978 } | 1081 } |
979 static _isNumericElement(element) { | 1082 static [_isNumericElement](element) { |
980 return dart.notNull(dart.is(element, core.num)) && dart.notNull((element
& 0x3ffffff) === element); | 1083 return dart.notNull(dart.is(element, core.num)) && dart.notNull((element
& 0x3ffffff) === element); |
981 } | 1084 } |
982 _computeHashCode(element) { | 1085 [_computeHashCode](element) { |
983 return dart.dload(element, 'hashCode') & 0x3ffffff; | 1086 return dart.dload(element, 'hashCode') & 0x3ffffff; |
984 } | 1087 } |
985 static _hasTableEntry(table, key) { | 1088 static [_hasTableEntry](table, key) { |
986 let entry = table[key]; | 1089 let entry = table[key]; |
987 return entry !== null; | 1090 return entry !== null; |
988 } | 1091 } |
989 static _setTableEntry(table, key, value) { | 1092 static [_setTableEntry](table, key, value) { |
990 dart.assert(value !== null); | 1093 dart.assert(value !== null); |
991 table[key] = value; | 1094 table[key] = value; |
992 } | 1095 } |
993 static _deleteTableEntry(table, key) { | 1096 static [_deleteTableEntry](table, key) { |
994 delete table[key]; | 1097 delete table[key]; |
995 } | 1098 } |
996 _getBucket(table, element) { | 1099 [_getBucket](table, element) { |
997 let hash = this._computeHashCode(element); | 1100 let hash = this[_computeHashCode](element); |
998 return dart.as(table[hash], core.List); | 1101 return dart.as(table[hash], core.List); |
999 } | 1102 } |
1000 _findBucketIndex(bucket, element) { | 1103 [_findBucketIndex](bucket, element) { |
1001 if (bucket === null) | 1104 if (bucket === null) |
1002 return -1; | 1105 return -1; |
1003 let length = bucket.length; | 1106 let length = bucket.length; |
1004 for (let i = 0; i < length; i++) { | 1107 for (let i = 0; i < length; i++) { |
1005 if (dart.equals(bucket[i], element)) | 1108 if (dart.equals(bucket[i], element)) |
1006 return i; | 1109 return i; |
1007 } | 1110 } |
1008 return -1; | 1111 return -1; |
1009 } | 1112 } |
1010 static _newHashTable() { | 1113 static [_newHashTable]() { |
1011 let table = Object.create(null); | 1114 let table = Object.create(null); |
1012 let temporaryKey = '<non-identifier-key>'; | 1115 let temporaryKey = '<non-identifier-key>'; |
1013 _setTableEntry(table, temporaryKey, table); | 1116 _setTableEntry(table, temporaryKey, table); |
1014 _deleteTableEntry(table, temporaryKey); | 1117 _deleteTableEntry(table, temporaryKey); |
1015 return table; | 1118 return table; |
1016 } | 1119 } |
1017 } | 1120 } |
1018 return _HashSet; | 1121 return _HashSet; |
1019 }); | 1122 }); |
1020 let _HashSet = _HashSet$(dynamic); | 1123 let _HashSet = _HashSet$(dynamic); |
1021 let _IdentityHashSet$ = dart.generic(function(E) { | 1124 let _IdentityHashSet$ = dart.generic(function(E) { |
1022 class _IdentityHashSet extends _HashSet$(E) { | 1125 class _IdentityHashSet extends _HashSet$(E) { |
1023 _newSet() { | 1126 [_newSet]() { |
1024 return new _IdentityHashSet(); | 1127 return new _IdentityHashSet(); |
1025 } | 1128 } |
1026 _computeHashCode(key) { | 1129 [_computeHashCode](key) { |
1027 return core.identityHashCode(key) & 0x3ffffff; | 1130 return core.identityHashCode(key) & 0x3ffffff; |
1028 } | 1131 } |
1029 _findBucketIndex(bucket, element) { | 1132 [_findBucketIndex](bucket, element) { |
1030 if (bucket === null) | 1133 if (bucket === null) |
1031 return -1; | 1134 return -1; |
1032 let length = bucket.length; | 1135 let length = bucket.length; |
1033 for (let i = 0; i < length; i++) { | 1136 for (let i = 0; i < length; i++) { |
1034 if (core.identical(bucket[i], element)) | 1137 if (core.identical(bucket[i], element)) |
1035 return i; | 1138 return i; |
1036 } | 1139 } |
1037 return -1; | 1140 return -1; |
1038 } | 1141 } |
1039 } | 1142 } |
1040 return _IdentityHashSet; | 1143 return _IdentityHashSet; |
1041 }); | 1144 }); |
1042 let _IdentityHashSet = _IdentityHashSet$(dynamic); | 1145 let _IdentityHashSet = _IdentityHashSet$(dynamic); |
1043 let _CustomHashSet$ = dart.generic(function(E) { | 1146 let _CustomHashSet$ = dart.generic(function(E) { |
1044 class _CustomHashSet extends _HashSet$(E) { | 1147 class _CustomHashSet extends _HashSet$(E) { |
1045 _CustomHashSet(_equality, _hasher, validKey) { | 1148 _CustomHashSet($_equality, $_hasher, validKey) { |
1046 this._equality = _equality; | 1149 this[_equality] = $_equality; |
1047 this._hasher = _hasher; | 1150 this[_hasher] = $_hasher; |
1048 this._validKey = dart.as(validKey !== null ? validKey : (x) => dart.is(x
, E), _Predicate); | 1151 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is(
x, E), _Predicate); |
1049 super._HashSet(); | 1152 super._HashSet(); |
1050 } | 1153 } |
1051 _newSet() { | 1154 [_newSet]() { |
1052 return new _CustomHashSet(this._equality, this._hasher, this._validKey); | 1155 return new _CustomHashSet(this[_equality], this[_hasher], this[_validKey
]); |
1053 } | 1156 } |
1054 _findBucketIndex(bucket, element) { | 1157 [_findBucketIndex](bucket, element) { |
1055 if (bucket === null) | 1158 if (bucket === null) |
1056 return -1; | 1159 return -1; |
1057 let length = bucket.length; | 1160 let length = bucket.length; |
1058 for (let i = 0; i < length; i++) { | 1161 for (let i = 0; i < length; i++) { |
1059 if (this._equality(dart.as(bucket[i], E), dart.as(element, E))) | 1162 if (this[_equality](dart.as(bucket[i], E), dart.as(element, E))) |
1060 return i; | 1163 return i; |
1061 } | 1164 } |
1062 return -1; | 1165 return -1; |
1063 } | 1166 } |
1064 _computeHashCode(element) { | 1167 [_computeHashCode](element) { |
1065 return this._hasher(dart.as(element, E)) & 0x3ffffff; | 1168 return this[_hasher](dart.as(element, E)) & 0x3ffffff; |
1066 } | 1169 } |
1067 add(object) { | 1170 add(object) { |
1068 return super._add(object); | 1171 return super._add(object); |
1069 } | 1172 } |
1070 contains(object) { | 1173 contains(object) { |
1071 if (!dart.notNull(this._validKey(object))) | 1174 if (!dart.notNull(this[_validKey](object))) |
1072 return false; | 1175 return false; |
1073 return super._contains(object); | 1176 return super._contains(object); |
1074 } | 1177 } |
1075 lookup(object) { | 1178 lookup(object) { |
1076 if (!dart.notNull(this._validKey(object))) | 1179 if (!dart.notNull(this[_validKey](object))) |
1077 return dart.as(null, E); | 1180 return dart.as(null, E); |
1078 return super._lookup(object); | 1181 return super._lookup(object); |
1079 } | 1182 } |
1080 remove(object) { | 1183 remove(object) { |
1081 if (!dart.notNull(this._validKey(object))) | 1184 if (!dart.notNull(this[_validKey](object))) |
1082 return false; | 1185 return false; |
1083 return super._remove(object); | 1186 return super._remove(object); |
1084 } | 1187 } |
1085 } | 1188 } |
1086 return _CustomHashSet; | 1189 return _CustomHashSet; |
1087 }); | 1190 }); |
1088 let _CustomHashSet = _CustomHashSet$(dynamic); | 1191 let _CustomHashSet = _CustomHashSet$(dynamic); |
1089 let HashSetIterator$ = dart.generic(function(E) { | 1192 let HashSetIterator$ = dart.generic(function(E) { |
1090 class HashSetIterator extends dart.Object { | 1193 class HashSetIterator extends dart.Object { |
1091 HashSetIterator(_set, _elements) { | 1194 HashSetIterator($_set, $_elements) { |
1092 this._set = _set; | 1195 this[_set] = $_set; |
1093 this._elements = _elements; | 1196 this[_elements] = $_elements; |
1094 this._offset = 0; | 1197 this[_offset] = 0; |
1095 this._current = dart.as(null, E); | 1198 this[_current] = dart.as(null, E); |
1096 } | 1199 } |
1097 get current() { | 1200 get current() { |
1098 return this._current; | 1201 return this[_current]; |
1099 } | 1202 } |
1100 moveNext() { | 1203 moveNext() { |
1101 let elements = this._elements; | 1204 let elements = this[_elements]; |
1102 let offset = this._offset; | 1205 let offset = this[_offset]; |
1103 if (elements !== dart.dload(this._set, '_elements')) { | 1206 if (elements !== dart.dload(this[_set], '_elements')) { |
1104 throw new core.ConcurrentModificationError(this._set); | 1207 throw new core.ConcurrentModificationError(this[_set]); |
1105 } else if (offset >= elements.length) { | 1208 } else if (offset >= elements.length) { |
1106 this._current = dart.as(null, E); | 1209 this[_current] = dart.as(null, E); |
1107 return false; | 1210 return false; |
1108 } else { | 1211 } else { |
1109 this._current = dart.as(elements[offset], E); | 1212 this[_current] = dart.as(elements[offset], E); |
1110 this._offset = offset + 1; | 1213 this[_offset] = offset + 1; |
1111 return true; | 1214 return true; |
1112 } | 1215 } |
1113 } | 1216 } |
1114 } | 1217 } |
1115 return HashSetIterator; | 1218 return HashSetIterator; |
1116 }); | 1219 }); |
1117 let HashSetIterator = HashSetIterator$(dynamic); | 1220 let HashSetIterator = HashSetIterator$(dynamic); |
1118 let _LinkedHashSet$ = dart.generic(function(E) { | 1221 let _LinkedHashSet$ = dart.generic(function(E) { |
1119 class _LinkedHashSet extends _HashSetBase$(E) { | 1222 class _LinkedHashSet extends _HashSetBase$(E) { |
1120 _LinkedHashSet() { | 1223 _LinkedHashSet() { |
1121 this._length = 0; | 1224 this[_length] = 0; |
1122 this._strings = null; | 1225 this[_strings] = null; |
1123 this._nums = null; | 1226 this[_nums] = null; |
1124 this._rest = null; | 1227 this[_rest] = null; |
1125 this._first = null; | 1228 this[_first] = null; |
1126 this._last = null; | 1229 this[_last] = null; |
1127 this._modifications = 0; | 1230 this[_modifications] = 0; |
1128 super._HashSetBase(); | 1231 super._HashSetBase(); |
1129 } | 1232 } |
1130 _newSet() { | 1233 [_newSet]() { |
1131 return new _LinkedHashSet(); | 1234 return new _LinkedHashSet(); |
1132 } | 1235 } |
1133 _unsupported(operation) { | 1236 [_unsupported](operation) { |
1134 throw `LinkedHashSet: unsupported ${operation}`; | 1237 throw `LinkedHashSet: unsupported ${operation}`; |
1135 } | 1238 } |
1136 get iterator() { | 1239 get iterator() { |
1137 return dart.as(new LinkedHashSetIterator(this, this._modifications), cor
e.Iterator$(E)); | 1240 return dart.as(new LinkedHashSetIterator(this, this[_modifications]), co
re.Iterator$(E)); |
1138 } | 1241 } |
1139 get length() { | 1242 get length() { |
1140 return this._length; | 1243 return this[_length]; |
1141 } | 1244 } |
1142 get isEmpty() { | 1245 get isEmpty() { |
1143 return this._length === 0; | 1246 return this[_length] === 0; |
1144 } | 1247 } |
1145 get isNotEmpty() { | 1248 get isNotEmpty() { |
1146 return !dart.notNull(this.isEmpty); | 1249 return !dart.notNull(this.isEmpty); |
1147 } | 1250 } |
1148 contains(object) { | 1251 contains(object) { |
1149 if (_isStringElement(object)) { | 1252 if (_isStringElement(object)) { |
1150 let strings = this._strings; | 1253 let strings = this[_strings]; |
1151 if (strings === null) | 1254 if (strings === null) |
1152 return false; | 1255 return false; |
1153 let cell = dart.as(_getTableEntry(strings, object), LinkedHashSetCell)
; | 1256 let cell = dart.as(_getTableEntry(strings, object), LinkedHashSetCell)
; |
1154 return cell !== null; | 1257 return cell !== null; |
1155 } else if (_isNumericElement(object)) { | 1258 } else if (_isNumericElement(object)) { |
1156 let nums = this._nums; | 1259 let nums = this[_nums]; |
1157 if (nums === null) | 1260 if (nums === null) |
1158 return false; | 1261 return false; |
1159 let cell = dart.as(_getTableEntry(nums, object), LinkedHashSetCell); | 1262 let cell = dart.as(_getTableEntry(nums, object), LinkedHashSetCell); |
1160 return cell !== null; | 1263 return cell !== null; |
1161 } else { | 1264 } else { |
1162 return this._contains(object); | 1265 return this[_contains](object); |
1163 } | 1266 } |
1164 } | 1267 } |
1165 _contains(object) { | 1268 [_contains](object) { |
1166 let rest = this._rest; | 1269 let rest = this[_rest]; |
1167 if (rest === null) | 1270 if (rest === null) |
1168 return false; | 1271 return false; |
1169 let bucket = this._getBucket(rest, object); | 1272 let bucket = this[_getBucket](rest, object); |
1170 return this._findBucketIndex(bucket, object) >= 0; | 1273 return this[_findBucketIndex](bucket, object) >= 0; |
1171 } | 1274 } |
1172 lookup(object) { | 1275 lookup(object) { |
1173 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle
ment(object))) { | 1276 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle
ment(object))) { |
1174 return dart.as(this.contains(object) ? object : null, E); | 1277 return dart.as(this.contains(object) ? object : null, E); |
1175 } else { | 1278 } else { |
1176 return this._lookup(object); | 1279 return this[_lookup](object); |
1177 } | 1280 } |
1178 } | 1281 } |
1179 _lookup(object) { | 1282 [_lookup](object) { |
1180 let rest = this._rest; | 1283 let rest = this[_rest]; |
1181 if (rest === null) | 1284 if (rest === null) |
1182 return dart.as(null, E); | 1285 return dart.as(null, E); |
1183 let bucket = this._getBucket(rest, object); | 1286 let bucket = this[_getBucket](rest, object); |
1184 let index = this._findBucketIndex(bucket, object); | 1287 let index = this[_findBucketIndex](bucket, object); |
1185 if (index < 0) | 1288 if (index < 0) |
1186 return dart.as(null, E); | 1289 return dart.as(null, E); |
1187 return dart.as(dart.dload(bucket.get(index), '_element'), E); | 1290 return dart.as(dart.dload(bucket.get(index), '_element'), E); |
1188 } | 1291 } |
1189 forEach(action) { | 1292 forEach(action) { |
1190 let cell = this._first; | 1293 let cell = this[_first]; |
1191 let modifications = this._modifications; | 1294 let modifications = this[_modifications]; |
1192 while (cell !== null) { | 1295 while (cell !== null) { |
1193 action(dart.as(cell._element, E)); | 1296 action(dart.as(cell[_element], E)); |
1194 if (modifications !== this._modifications) { | 1297 if (modifications !== this[_modifications]) { |
1195 throw new core.ConcurrentModificationError(this); | 1298 throw new core.ConcurrentModificationError(this); |
1196 } | 1299 } |
1197 cell = cell._next; | 1300 cell = cell[_next]; |
1198 } | 1301 } |
1199 } | 1302 } |
1200 get first() { | 1303 get first() { |
1201 if (this._first === null) | 1304 if (this[_first] === null) |
1202 throw new core.StateError("No elements"); | 1305 throw new core.StateError("No elements"); |
1203 return dart.as(this._first._element, E); | 1306 return dart.as(this[_first][_element], E); |
1204 } | 1307 } |
1205 get last() { | 1308 get last() { |
1206 if (this._last === null) | 1309 if (this[_last] === null) |
1207 throw new core.StateError("No elements"); | 1310 throw new core.StateError("No elements"); |
1208 return dart.as(this._last._element, E); | 1311 return dart.as(this[_last][_element], E); |
1209 } | 1312 } |
1210 add(element) { | 1313 add(element) { |
1211 if (_isStringElement(element)) { | 1314 if (_isStringElement(element)) { |
1212 let strings = this._strings; | 1315 let strings = this[_strings]; |
1213 if (strings === null) | 1316 if (strings === null) |
1214 this._strings = strings = _newHashTable(); | 1317 this[_strings] = strings = _newHashTable(); |
1215 return this._addHashTableEntry(strings, element); | 1318 return this[_addHashTableEntry](strings, element); |
1216 } else if (_isNumericElement(element)) { | 1319 } else if (_isNumericElement(element)) { |
1217 let nums = this._nums; | 1320 let nums = this[_nums]; |
1218 if (nums === null) | 1321 if (nums === null) |
1219 this._nums = nums = _newHashTable(); | 1322 this[_nums] = nums = _newHashTable(); |
1220 return this._addHashTableEntry(nums, element); | 1323 return this[_addHashTableEntry](nums, element); |
1221 } else { | 1324 } else { |
1222 return this._add(element); | 1325 return this[_add](element); |
1223 } | 1326 } |
1224 } | 1327 } |
1225 _add(element) { | 1328 [_add](element) { |
1226 let rest = this._rest; | 1329 let rest = this[_rest]; |
1227 if (rest === null) | 1330 if (rest === null) |
1228 this._rest = rest = _newHashTable(); | 1331 this[_rest] = rest = _newHashTable(); |
1229 let hash = this._computeHashCode(element); | 1332 let hash = this[_computeHashCode](element); |
1230 let bucket = rest[hash]; | 1333 let bucket = rest[hash]; |
1231 if (bucket === null) { | 1334 if (bucket === null) { |
1232 let cell = this._newLinkedCell(element); | 1335 let cell = this[_newLinkedCell](element); |
1233 _setTableEntry(rest, hash, [cell]); | 1336 _setTableEntry(rest, hash, [cell]); |
1234 } else { | 1337 } else { |
1235 let index = this._findBucketIndex(bucket, element); | 1338 let index = this[_findBucketIndex](bucket, element); |
1236 if (index >= 0) | 1339 if (index >= 0) |
1237 return false; | 1340 return false; |
1238 let cell = this._newLinkedCell(element); | 1341 let cell = this[_newLinkedCell](element); |
1239 bucket.push(cell); | 1342 bucket.push(cell); |
1240 } | 1343 } |
1241 return true; | 1344 return true; |
1242 } | 1345 } |
1243 remove(object) { | 1346 remove(object) { |
1244 if (_isStringElement(object)) { | 1347 if (_isStringElement(object)) { |
1245 return this._removeHashTableEntry(this._strings, object); | 1348 return this[_removeHashTableEntry](this[_strings], object); |
1246 } else if (_isNumericElement(object)) { | 1349 } else if (_isNumericElement(object)) { |
1247 return this._removeHashTableEntry(this._nums, object); | 1350 return this[_removeHashTableEntry](this[_nums], object); |
1248 } else { | 1351 } else { |
1249 return this._remove(object); | 1352 return this[_remove](object); |
1250 } | 1353 } |
1251 } | 1354 } |
1252 _remove(object) { | 1355 [_remove](object) { |
1253 let rest = this._rest; | 1356 let rest = this[_rest]; |
1254 if (rest === null) | 1357 if (rest === null) |
1255 return false; | 1358 return false; |
1256 let bucket = this._getBucket(rest, object); | 1359 let bucket = this[_getBucket](rest, object); |
1257 let index = this._findBucketIndex(bucket, object); | 1360 let index = this[_findBucketIndex](bucket, object); |
1258 if (index < 0) | 1361 if (index < 0) |
1259 return false; | 1362 return false; |
1260 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashSetCell); | 1363 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashSetCell); |
1261 this._unlinkCell(cell); | 1364 this[_unlinkCell](cell); |
1262 return true; | 1365 return true; |
1263 } | 1366 } |
1264 removeWhere(test) { | 1367 removeWhere(test) { |
1265 this._filterWhere(test, true); | 1368 this[_filterWhere](test, true); |
1266 } | 1369 } |
1267 retainWhere(test) { | 1370 retainWhere(test) { |
1268 this._filterWhere(test, false); | 1371 this[_filterWhere](test, false); |
1269 } | 1372 } |
1270 _filterWhere(test, removeMatching) { | 1373 [_filterWhere](test, removeMatching) { |
1271 let cell = this._first; | 1374 let cell = this[_first]; |
1272 while (cell !== null) { | 1375 while (cell !== null) { |
1273 let element = dart.as(cell._element, E); | 1376 let element = dart.as(cell[_element], E); |
1274 let next = cell._next; | 1377 let next = cell[_next]; |
1275 let modifications = this._modifications; | 1378 let modifications = this[_modifications]; |
1276 let shouldRemove = removeMatching === test(element); | 1379 let shouldRemove = removeMatching === test(element); |
1277 if (modifications !== this._modifications) { | 1380 if (modifications !== this[_modifications]) { |
1278 throw new core.ConcurrentModificationError(this); | 1381 throw new core.ConcurrentModificationError(this); |
1279 } | 1382 } |
1280 if (shouldRemove) | 1383 if (shouldRemove) |
1281 this.remove(element); | 1384 this.remove(element); |
1282 cell = next; | 1385 cell = next; |
1283 } | 1386 } |
1284 } | 1387 } |
1285 clear() { | 1388 clear() { |
1286 if (this._length > 0) { | 1389 if (this[_length] > 0) { |
1287 this._strings = this._nums = this._rest = this._first = this._last = n
ull; | 1390 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last
] = null; |
1288 this._length = 0; | 1391 this[_length] = 0; |
1289 this._modified(); | 1392 this[_modified](); |
1290 } | 1393 } |
1291 } | 1394 } |
1292 _addHashTableEntry(table, element) { | 1395 [_addHashTableEntry](table, element) { |
1293 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); | 1396 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); |
1294 if (cell !== null) | 1397 if (cell !== null) |
1295 return false; | 1398 return false; |
1296 _setTableEntry(table, element, this._newLinkedCell(element)); | 1399 _setTableEntry(table, element, this[_newLinkedCell](element)); |
1297 return true; | 1400 return true; |
1298 } | 1401 } |
1299 _removeHashTableEntry(table, element) { | 1402 [_removeHashTableEntry](table, element) { |
1300 if (table === null) | 1403 if (table === null) |
1301 return false; | 1404 return false; |
1302 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); | 1405 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); |
1303 if (cell === null) | 1406 if (cell === null) |
1304 return false; | 1407 return false; |
1305 this._unlinkCell(cell); | 1408 this[_unlinkCell](cell); |
1306 _deleteTableEntry(table, element); | 1409 _deleteTableEntry(table, element); |
1307 return true; | 1410 return true; |
1308 } | 1411 } |
1309 _modified() { | 1412 [_modified]() { |
1310 this._modifications = this._modifications + 1 & 67108863; | 1413 this[_modifications] = this[_modifications] + 1 & 67108863; |
1311 } | 1414 } |
1312 _newLinkedCell(element) { | 1415 [_newLinkedCell](element) { |
1313 let cell = new LinkedHashSetCell(element); | 1416 let cell = new LinkedHashSetCell(element); |
1314 if (this._first === null) { | 1417 if (this[_first] === null) { |
1315 this._first = this._last = cell; | 1418 this[_first] = this[_last] = cell; |
1316 } else { | 1419 } else { |
1317 let last = this._last; | 1420 let last = this[_last]; |
1318 cell._previous = last; | 1421 cell[_previous] = last; |
1319 this._last = last._next = cell; | 1422 this[_last] = last[_next] = cell; |
1320 } | 1423 } |
1321 this._length++; | 1424 this[_length]++; |
1322 this._modified(); | 1425 this[_modified](); |
1323 return cell; | 1426 return cell; |
1324 } | 1427 } |
1325 _unlinkCell(cell) { | 1428 [_unlinkCell](cell) { |
1326 let previous = cell._previous; | 1429 let previous = cell[_previous]; |
1327 let next = cell._next; | 1430 let next = cell[_next]; |
1328 if (previous === null) { | 1431 if (previous === null) { |
1329 dart.assert(dart.equals(cell, this._first)); | 1432 dart.assert(dart.equals(cell, this[_first])); |
1330 this._first = next; | 1433 this[_first] = next; |
1331 } else { | 1434 } else { |
1332 previous._next = next; | 1435 previous[_next] = next; |
1333 } | 1436 } |
1334 if (next === null) { | 1437 if (next === null) { |
1335 dart.assert(dart.equals(cell, this._last)); | 1438 dart.assert(dart.equals(cell, this[_last])); |
1336 this._last = previous; | 1439 this[_last] = previous; |
1337 } else { | 1440 } else { |
1338 next._previous = previous; | 1441 next[_previous] = previous; |
1339 } | 1442 } |
1340 this._length--; | 1443 this[_length]--; |
1341 this._modified(); | 1444 this[_modified](); |
1342 } | 1445 } |
1343 static _isStringElement(element) { | 1446 static [_isStringElement](element) { |
1344 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa
ls(element, '__proto__')); | 1447 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa
ls(element, '__proto__')); |
1345 } | 1448 } |
1346 static _isNumericElement(element) { | 1449 static [_isNumericElement](element) { |
1347 return dart.notNull(dart.is(element, core.num)) && dart.notNull((element
& 0x3ffffff) === element); | 1450 return dart.notNull(dart.is(element, core.num)) && dart.notNull((element
& 0x3ffffff) === element); |
1348 } | 1451 } |
1349 _computeHashCode(element) { | 1452 [_computeHashCode](element) { |
1350 return dart.dload(element, 'hashCode') & 0x3ffffff; | 1453 return dart.dload(element, 'hashCode') & 0x3ffffff; |
1351 } | 1454 } |
1352 static _getTableEntry(table, key) { | 1455 static [_getTableEntry](table, key) { |
1353 return table[key]; | 1456 return table[key]; |
1354 } | 1457 } |
1355 static _setTableEntry(table, key, value) { | 1458 static [_setTableEntry](table, key, value) { |
1356 dart.assert(value !== null); | 1459 dart.assert(value !== null); |
1357 table[key] = value; | 1460 table[key] = value; |
1358 } | 1461 } |
1359 static _deleteTableEntry(table, key) { | 1462 static [_deleteTableEntry](table, key) { |
1360 delete table[key]; | 1463 delete table[key]; |
1361 } | 1464 } |
1362 _getBucket(table, element) { | 1465 [_getBucket](table, element) { |
1363 let hash = this._computeHashCode(element); | 1466 let hash = this[_computeHashCode](element); |
1364 return dart.as(table[hash], core.List); | 1467 return dart.as(table[hash], core.List); |
1365 } | 1468 } |
1366 _findBucketIndex(bucket, element) { | 1469 [_findBucketIndex](bucket, element) { |
1367 if (bucket === null) | 1470 if (bucket === null) |
1368 return -1; | 1471 return -1; |
1369 let length = bucket.length; | 1472 let length = bucket.length; |
1370 for (let i = 0; i < length; i++) { | 1473 for (let i = 0; i < length; i++) { |
1371 let cell = dart.as(bucket[i], LinkedHashSetCell); | 1474 let cell = dart.as(bucket[i], LinkedHashSetCell); |
1372 if (dart.equals(cell._element, element)) | 1475 if (dart.equals(cell[_element], element)) |
1373 return i; | 1476 return i; |
1374 } | 1477 } |
1375 return -1; | 1478 return -1; |
1376 } | 1479 } |
1377 static _newHashTable() { | 1480 static [_newHashTable]() { |
1378 let table = Object.create(null); | 1481 let table = Object.create(null); |
1379 let temporaryKey = '<non-identifier-key>'; | 1482 let temporaryKey = '<non-identifier-key>'; |
1380 _setTableEntry(table, temporaryKey, table); | 1483 _setTableEntry(table, temporaryKey, table); |
1381 _deleteTableEntry(table, temporaryKey); | 1484 _deleteTableEntry(table, temporaryKey); |
1382 return table; | 1485 return table; |
1383 } | 1486 } |
1384 } | 1487 } |
1385 return _LinkedHashSet; | 1488 return _LinkedHashSet; |
1386 }); | 1489 }); |
1387 let _LinkedHashSet = _LinkedHashSet$(dynamic); | 1490 let _LinkedHashSet = _LinkedHashSet$(dynamic); |
1388 let _LinkedIdentityHashSet$ = dart.generic(function(E) { | 1491 let _LinkedIdentityHashSet$ = dart.generic(function(E) { |
1389 class _LinkedIdentityHashSet extends _LinkedHashSet$(E) { | 1492 class _LinkedIdentityHashSet extends _LinkedHashSet$(E) { |
1390 _newSet() { | 1493 [_newSet]() { |
1391 return new _LinkedIdentityHashSet(); | 1494 return new _LinkedIdentityHashSet(); |
1392 } | 1495 } |
1393 _computeHashCode(key) { | 1496 [_computeHashCode](key) { |
1394 return core.identityHashCode(key) & 0x3ffffff; | 1497 return core.identityHashCode(key) & 0x3ffffff; |
1395 } | 1498 } |
1396 _findBucketIndex(bucket, element) { | 1499 [_findBucketIndex](bucket, element) { |
1397 if (bucket === null) | 1500 if (bucket === null) |
1398 return -1; | 1501 return -1; |
1399 let length = bucket.length; | 1502 let length = bucket.length; |
1400 for (let i = 0; i < length; i++) { | 1503 for (let i = 0; i < length; i++) { |
1401 let cell = dart.as(bucket[i], LinkedHashSetCell); | 1504 let cell = dart.as(bucket[i], LinkedHashSetCell); |
1402 if (core.identical(cell._element, element)) | 1505 if (core.identical(cell[_element], element)) |
1403 return i; | 1506 return i; |
1404 } | 1507 } |
1405 return -1; | 1508 return -1; |
1406 } | 1509 } |
1407 } | 1510 } |
1408 return _LinkedIdentityHashSet; | 1511 return _LinkedIdentityHashSet; |
1409 }); | 1512 }); |
1410 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$(dynamic); | 1513 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$(dynamic); |
1411 let _LinkedCustomHashSet$ = dart.generic(function(E) { | 1514 let _LinkedCustomHashSet$ = dart.generic(function(E) { |
1412 class _LinkedCustomHashSet extends _LinkedHashSet$(E) { | 1515 class _LinkedCustomHashSet extends _LinkedHashSet$(E) { |
1413 _LinkedCustomHashSet(_equality, _hasher, validKey) { | 1516 _LinkedCustomHashSet($_equality, $_hasher, validKey) { |
1414 this._equality = _equality; | 1517 this[_equality] = $_equality; |
1415 this._hasher = _hasher; | 1518 this[_hasher] = $_hasher; |
1416 this._validKey = dart.as(validKey !== null ? validKey : (x) => dart.is(x
, E), _Predicate); | 1519 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is(
x, E), _Predicate); |
1417 super._LinkedHashSet(); | 1520 super._LinkedHashSet(); |
1418 } | 1521 } |
1419 _newSet() { | 1522 [_newSet]() { |
1420 return new _LinkedCustomHashSet(this._equality, this._hasher, this._vali
dKey); | 1523 return new _LinkedCustomHashSet(this[_equality], this[_hasher], this[_va
lidKey]); |
1421 } | 1524 } |
1422 _findBucketIndex(bucket, element) { | 1525 [_findBucketIndex](bucket, element) { |
1423 if (bucket === null) | 1526 if (bucket === null) |
1424 return -1; | 1527 return -1; |
1425 let length = bucket.length; | 1528 let length = bucket.length; |
1426 for (let i = 0; i < length; i++) { | 1529 for (let i = 0; i < length; i++) { |
1427 let cell = dart.as(bucket[i], LinkedHashSetCell); | 1530 let cell = dart.as(bucket[i], LinkedHashSetCell); |
1428 if (this._equality(dart.as(cell._element, E), dart.as(element, E))) | 1531 if (this[_equality](dart.as(cell[_element], E), dart.as(element, E))) |
1429 return i; | 1532 return i; |
1430 } | 1533 } |
1431 return -1; | 1534 return -1; |
1432 } | 1535 } |
1433 _computeHashCode(element) { | 1536 [_computeHashCode](element) { |
1434 return this._hasher(dart.as(element, E)) & 0x3ffffff; | 1537 return this[_hasher](dart.as(element, E)) & 0x3ffffff; |
1435 } | 1538 } |
1436 add(element) { | 1539 add(element) { |
1437 return super._add(element); | 1540 return super._add(element); |
1438 } | 1541 } |
1439 contains(object) { | 1542 contains(object) { |
1440 if (!dart.notNull(this._validKey(object))) | 1543 if (!dart.notNull(this[_validKey](object))) |
1441 return false; | 1544 return false; |
1442 return super._contains(object); | 1545 return super._contains(object); |
1443 } | 1546 } |
1444 lookup(object) { | 1547 lookup(object) { |
1445 if (!dart.notNull(this._validKey(object))) | 1548 if (!dart.notNull(this[_validKey](object))) |
1446 return dart.as(null, E); | 1549 return dart.as(null, E); |
1447 return super._lookup(object); | 1550 return super._lookup(object); |
1448 } | 1551 } |
1449 remove(object) { | 1552 remove(object) { |
1450 if (!dart.notNull(this._validKey(object))) | 1553 if (!dart.notNull(this[_validKey](object))) |
1451 return false; | 1554 return false; |
1452 return super._remove(object); | 1555 return super._remove(object); |
1453 } | 1556 } |
1454 containsAll(elements) { | 1557 containsAll(elements) { |
1455 for (let element of elements) { | 1558 for (let element of elements) { |
1456 if (dart.notNull(!dart.notNull(this._validKey(element))) || dart.notNu
ll(!dart.notNull(this.contains(element)))) | 1559 if (dart.notNull(!dart.notNull(this[_validKey](element))) || dart.notN
ull(!dart.notNull(this.contains(element)))) |
1457 return false; | 1560 return false; |
1458 } | 1561 } |
1459 return true; | 1562 return true; |
1460 } | 1563 } |
1461 removeAll(elements) { | 1564 removeAll(elements) { |
1462 for (let element of elements) { | 1565 for (let element of elements) { |
1463 if (this._validKey(element)) { | 1566 if (this[_validKey](element)) { |
1464 super._remove(element); | 1567 super._remove(element); |
1465 } | 1568 } |
1466 } | 1569 } |
1467 } | 1570 } |
1468 } | 1571 } |
1469 return _LinkedCustomHashSet; | 1572 return _LinkedCustomHashSet; |
1470 }); | 1573 }); |
1471 let _LinkedCustomHashSet = _LinkedCustomHashSet$(dynamic); | 1574 let _LinkedCustomHashSet = _LinkedCustomHashSet$(dynamic); |
1472 class LinkedHashSetCell extends dart.Object { | 1575 class LinkedHashSetCell extends dart.Object { |
1473 LinkedHashSetCell(_element) { | 1576 LinkedHashSetCell($_element) { |
1474 this._element = _element; | 1577 this[_element] = $_element; |
1475 this._next = null; | 1578 this[_next] = null; |
1476 this._previous = null; | 1579 this[_previous] = null; |
1477 } | 1580 } |
1478 } | 1581 } |
1479 let LinkedHashSetIterator$ = dart.generic(function(E) { | 1582 let LinkedHashSetIterator$ = dart.generic(function(E) { |
1480 class LinkedHashSetIterator extends dart.Object { | 1583 class LinkedHashSetIterator extends dart.Object { |
1481 LinkedHashSetIterator(_set, _modifications) { | 1584 LinkedHashSetIterator($_set, $_modifications) { |
1482 this._set = _set; | 1585 this[_set] = $_set; |
1483 this._modifications = _modifications; | 1586 this[_modifications] = $_modifications; |
1484 this._cell = null; | 1587 this[_cell] = null; |
1485 this._current = dart.as(null, E); | 1588 this[_current] = dart.as(null, E); |
1486 this._cell = dart.as(dart.dload(this._set, '_first'), LinkedHashSetCell)
; | 1589 this[_cell] = dart.as(dart.dload(this[_set], '_first'), LinkedHashSetCel
l); |
1487 } | 1590 } |
1488 get current() { | 1591 get current() { |
1489 return this._current; | 1592 return this[_current]; |
1490 } | 1593 } |
1491 moveNext() { | 1594 moveNext() { |
1492 if (this._modifications !== dart.dload(this._set, '_modifications')) { | 1595 if (this[_modifications] !== dart.dload(this[_set], '_modifications')) { |
1493 throw new core.ConcurrentModificationError(this._set); | 1596 throw new core.ConcurrentModificationError(this[_set]); |
1494 } else if (this._cell === null) { | 1597 } else if (this[_cell] === null) { |
1495 this._current = dart.as(null, E); | 1598 this[_current] = dart.as(null, E); |
1496 return false; | 1599 return false; |
1497 } else { | 1600 } else { |
1498 this._current = dart.as(this._cell._element, E); | 1601 this[_current] = dart.as(this[_cell][_element], E); |
1499 this._cell = this._cell._next; | 1602 this[_cell] = this[_cell][_next]; |
1500 return true; | 1603 return true; |
1501 } | 1604 } |
1502 } | 1605 } |
1503 } | 1606 } |
1504 return LinkedHashSetIterator; | 1607 return LinkedHashSetIterator; |
1505 }); | 1608 }); |
1506 let LinkedHashSetIterator = LinkedHashSetIterator$(dynamic); | 1609 let LinkedHashSetIterator = LinkedHashSetIterator$(dynamic); |
1507 let UnmodifiableListView$ = dart.generic(function(E) { | 1610 let UnmodifiableListView$ = dart.generic(function(E) { |
1508 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) { | 1611 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) { |
1509 UnmodifiableListView(source) { | 1612 UnmodifiableListView(source) { |
1510 this._source = source; | 1613 this[_source] = source; |
1511 super.UnmodifiableListBase(); | 1614 super.UnmodifiableListBase(); |
1512 } | 1615 } |
1513 get length() { | 1616 get length() { |
1514 return this._source.length; | 1617 return this[_source].length; |
1515 } | 1618 } |
1516 get(index) { | 1619 get(index) { |
1517 return this._source.elementAt(index); | 1620 return this[_source].elementAt(index); |
1518 } | 1621 } |
1519 } | 1622 } |
1520 return UnmodifiableListView; | 1623 return UnmodifiableListView; |
1521 }); | 1624 }); |
1522 let UnmodifiableListView = UnmodifiableListView$(dynamic); | 1625 let UnmodifiableListView = UnmodifiableListView$(dynamic); |
1523 // Function _defaultEquals: (dynamic, dynamic) → bool | 1626 // Function _defaultEquals: (dynamic, dynamic) → bool |
1524 function _defaultEquals(a, b) { | 1627 function _defaultEquals(a, b) { |
1525 return dart.equals(a, b); | 1628 return dart.equals(a, b); |
1526 } | 1629 } |
1527 // Function _defaultHashCode: (dynamic) → int | 1630 // Function _defaultHashCode: (dynamic) → int |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 dart.defineNamedConstructor(HashMap, 'identity'); | 1687 dart.defineNamedConstructor(HashMap, 'identity'); |
1585 dart.defineNamedConstructor(HashMap, 'from'); | 1688 dart.defineNamedConstructor(HashMap, 'from'); |
1586 dart.defineNamedConstructor(HashMap, 'fromIterable'); | 1689 dart.defineNamedConstructor(HashMap, 'fromIterable'); |
1587 dart.defineNamedConstructor(HashMap, 'fromIterables'); | 1690 dart.defineNamedConstructor(HashMap, 'fromIterables'); |
1588 return HashMap; | 1691 return HashMap; |
1589 }); | 1692 }); |
1590 let HashMap = HashMap$(dynamic, dynamic); | 1693 let HashMap = HashMap$(dynamic, dynamic); |
1591 let _HashSetBase$ = dart.generic(function(E) { | 1694 let _HashSetBase$ = dart.generic(function(E) { |
1592 class _HashSetBase extends SetBase$(E) { | 1695 class _HashSetBase extends SetBase$(E) { |
1593 difference(other) { | 1696 difference(other) { |
1594 let result = this._newSet(); | 1697 let result = this[_newSet](); |
1595 for (let element of this) { | 1698 for (let element of this) { |
1596 if (!dart.notNull(other.contains(element))) | 1699 if (!dart.notNull(other.contains(element))) |
1597 result.add(dart.as(element, E)); | 1700 result.add(dart.as(element, E)); |
1598 } | 1701 } |
1599 return result; | 1702 return result; |
1600 } | 1703 } |
1601 intersection(other) { | 1704 intersection(other) { |
1602 let result = this._newSet(); | 1705 let result = this[_newSet](); |
1603 for (let element of this) { | 1706 for (let element of this) { |
1604 if (other.contains(element)) | 1707 if (other.contains(element)) |
1605 result.add(dart.as(element, E)); | 1708 result.add(dart.as(element, E)); |
1606 } | 1709 } |
1607 return result; | 1710 return result; |
1608 } | 1711 } |
1609 toSet() { | 1712 toSet() { |
1610 return ((_) => { | 1713 return ((_) => { |
1611 _.addAll(this); | 1714 _.addAll(this); |
1612 return _; | 1715 return _; |
1613 }).bind(this)(this._newSet()); | 1716 }).bind(this)(this[_newSet]()); |
1614 } | 1717 } |
1615 } | 1718 } |
1616 return _HashSetBase; | 1719 return _HashSetBase; |
1617 }); | 1720 }); |
1618 let _HashSetBase = _HashSetBase$(dynamic); | 1721 let _HashSetBase = _HashSetBase$(dynamic); |
1619 let HashSet$ = dart.generic(function(E) { | 1722 let HashSet$ = dart.generic(function(E) { |
1620 class HashSet extends dart.Object { | 1723 class HashSet extends dart.Object { |
1621 HashSet(opt$) { | 1724 HashSet(opt$) { |
1622 let equals = opt$.equals === void 0 ? null : opt$.equals; | 1725 let equals = opt$.equals === void 0 ? null : opt$.equals; |
1623 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; | 1726 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2086 _toStringVisiting.add(iterable); | 2189 _toStringVisiting.add(iterable); |
2087 try { | 2190 try { |
2088 buffer.writeAll(iterable, ", "); | 2191 buffer.writeAll(iterable, ", "); |
2089 } finally { | 2192 } finally { |
2090 dart.assert(core.identical(_toStringVisiting.last, iterable)); | 2193 dart.assert(core.identical(_toStringVisiting.last, iterable)); |
2091 _toStringVisiting.removeLast(); | 2194 _toStringVisiting.removeLast(); |
2092 } | 2195 } |
2093 buffer.write(rightDelimiter); | 2196 buffer.write(rightDelimiter); |
2094 return buffer.toString(); | 2197 return buffer.toString(); |
2095 } | 2198 } |
2096 static _isToStringVisiting(o) { | 2199 static [_isToStringVisiting](o) { |
2097 for (let i = 0; i < _toStringVisiting.length; i++) { | 2200 for (let i = 0; i < _toStringVisiting.length; i++) { |
2098 if (core.identical(o, _toStringVisiting.get(i))) | 2201 if (core.identical(o, _toStringVisiting.get(i))) |
2099 return true; | 2202 return true; |
2100 } | 2203 } |
2101 return false; | 2204 return false; |
2102 } | 2205 } |
2103 static _iterablePartsToStrings(iterable, parts) { | 2206 static [_iterablePartsToStrings](iterable, parts) { |
2104 let LENGTH_LIMIT = 80; | 2207 let LENGTH_LIMIT = 80; |
2105 let HEAD_COUNT = 3; | 2208 let HEAD_COUNT = 3; |
2106 let TAIL_COUNT = 2; | 2209 let TAIL_COUNT = 2; |
2107 let MAX_COUNT = 100; | 2210 let MAX_COUNT = 100; |
2108 let OVERHEAD = 2; | 2211 let OVERHEAD = 2; |
2109 let ELLIPSIS_SIZE = 3; | 2212 let ELLIPSIS_SIZE = 3; |
2110 let length = 0; | 2213 let length = 0; |
2111 let count = 0; | 2214 let count = 0; |
2112 let it = iterable.iterator; | 2215 let it = iterable.iterator; |
2113 while (dart.notNull(length < LENGTH_LIMIT) || dart.notNull(count < HEAD_
COUNT)) { | 2216 while (dart.notNull(length < LENGTH_LIMIT) || dart.notNull(count < HEAD_
COUNT)) { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2182 dart.defineLazyProperties(IterableBase, { | 2285 dart.defineLazyProperties(IterableBase, { |
2183 get _toStringVisiting() { | 2286 get _toStringVisiting() { |
2184 return new List.from([]); | 2287 return new List.from([]); |
2185 } | 2288 } |
2186 }); | 2289 }); |
2187 return IterableBase; | 2290 return IterableBase; |
2188 }); | 2291 }); |
2189 let IterableBase = IterableBase$(dynamic); | 2292 let IterableBase = IterableBase$(dynamic); |
2190 let HasNextIterator$ = dart.generic(function(E) { | 2293 let HasNextIterator$ = dart.generic(function(E) { |
2191 class HasNextIterator extends dart.Object { | 2294 class HasNextIterator extends dart.Object { |
2192 HasNextIterator(_iterator) { | 2295 HasNextIterator($_iterator) { |
2193 this._iterator = _iterator; | 2296 this[_iterator] = $_iterator; |
2194 this._state = _NOT_MOVED_YET; | 2297 this[_state] = _NOT_MOVED_YET; |
2195 } | 2298 } |
2196 get hasNext() { | 2299 get hasNext() { |
2197 if (this._state === _NOT_MOVED_YET) | 2300 if (this[_state] === _NOT_MOVED_YET) |
2198 this._move(); | 2301 this[_move](); |
2199 return this._state === _HAS_NEXT_AND_NEXT_IN_CURRENT; | 2302 return this[_state] === _HAS_NEXT_AND_NEXT_IN_CURRENT; |
2200 } | 2303 } |
2201 next() { | 2304 next() { |
2202 if (!dart.notNull(this.hasNext)) | 2305 if (!dart.notNull(this.hasNext)) |
2203 throw new core.StateError("No more elements"); | 2306 throw new core.StateError("No more elements"); |
2204 dart.assert(this._state === _HAS_NEXT_AND_NEXT_IN_CURRENT); | 2307 dart.assert(this[_state] === _HAS_NEXT_AND_NEXT_IN_CURRENT); |
2205 let result = dart.as(this._iterator.current, E); | 2308 let result = dart.as(this[_iterator].current, E); |
2206 this._move(); | 2309 this[_move](); |
2207 return result; | 2310 return result; |
2208 } | 2311 } |
2209 _move() { | 2312 [_move]() { |
2210 if (this._iterator.moveNext()) { | 2313 if (this[_iterator].moveNext()) { |
2211 this._state = _HAS_NEXT_AND_NEXT_IN_CURRENT; | 2314 this[_state] = _HAS_NEXT_AND_NEXT_IN_CURRENT; |
2212 } else { | 2315 } else { |
2213 this._state = _NO_NEXT; | 2316 this[_state] = _NO_NEXT; |
2214 } | 2317 } |
2215 } | 2318 } |
2216 } | 2319 } |
2217 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0; | 2320 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0; |
2218 HasNextIterator._NO_NEXT = 1; | 2321 HasNextIterator._NO_NEXT = 1; |
2219 HasNextIterator._NOT_MOVED_YET = 2; | 2322 HasNextIterator._NOT_MOVED_YET = 2; |
2220 return HasNextIterator; | 2323 return HasNextIterator; |
2221 }); | 2324 }); |
2222 let HasNextIterator = HasNextIterator$(dynamic); | 2325 let HasNextIterator = HasNextIterator$(dynamic); |
2223 let LinkedHashMap$ = dart.generic(function(K, V) { | 2326 let LinkedHashMap$ = dart.generic(function(K, V) { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2330 } | 2433 } |
2331 } | 2434 } |
2332 dart.defineNamedConstructor(LinkedHashSet, 'identity'); | 2435 dart.defineNamedConstructor(LinkedHashSet, 'identity'); |
2333 dart.defineNamedConstructor(LinkedHashSet, 'from'); | 2436 dart.defineNamedConstructor(LinkedHashSet, 'from'); |
2334 return LinkedHashSet; | 2437 return LinkedHashSet; |
2335 }); | 2438 }); |
2336 let LinkedHashSet = LinkedHashSet$(dynamic); | 2439 let LinkedHashSet = LinkedHashSet$(dynamic); |
2337 let LinkedList$ = dart.generic(function(E) { | 2440 let LinkedList$ = dart.generic(function(E) { |
2338 class LinkedList extends IterableBase$(E) { | 2441 class LinkedList extends IterableBase$(E) { |
2339 LinkedList() { | 2442 LinkedList() { |
2340 this._modificationCount = 0; | 2443 this[_modificationCount] = 0; |
2341 this._length = 0; | 2444 this[_length] = 0; |
2342 this._next = null; | 2445 this[_next] = null; |
2343 this._previous = null; | 2446 this[_previous] = null; |
2344 super.IterableBase(); | 2447 super.IterableBase(); |
2345 this._next = this._previous = this; | 2448 this[_next] = this[_previous] = this; |
2346 } | 2449 } |
2347 addFirst(entry) { | 2450 addFirst(entry) { |
2348 this._insertAfter(this, entry); | 2451 this[_insertAfter](this, entry); |
2349 } | 2452 } |
2350 add(entry) { | 2453 add(entry) { |
2351 this._insertAfter(this._previous, entry); | 2454 this[_insertAfter](this[_previous], entry); |
2352 } | 2455 } |
2353 addAll(entries) { | 2456 addAll(entries) { |
2354 entries.forEach(((entry) => this._insertAfter(this._previous, dart.as(en
try, E))).bind(this)); | 2457 entries.forEach(((entry) => this[_insertAfter](this[_previous], dart.as(
entry, E))).bind(this)); |
2355 } | 2458 } |
2356 remove(entry) { | 2459 remove(entry) { |
2357 if (!dart.equals(entry._list, this)) | 2460 if (!dart.equals(entry[_list], this)) |
2358 return false; | 2461 return false; |
2359 this._unlink(entry); | 2462 this[_unlink](entry); |
2360 return true; | 2463 return true; |
2361 } | 2464 } |
2362 get iterator() { | 2465 get iterator() { |
2363 return new _LinkedListIterator(this); | 2466 return new _LinkedListIterator(this); |
2364 } | 2467 } |
2365 get length() { | 2468 get length() { |
2366 return this._length; | 2469 return this[_length]; |
2367 } | 2470 } |
2368 clear() { | 2471 clear() { |
2369 this._modificationCount++; | 2472 this[_modificationCount]++; |
2370 let next = this._next; | 2473 let next = this[_next]; |
2371 while (!dart.notNull(core.identical(next, this))) { | 2474 while (!dart.notNull(core.identical(next, this))) { |
2372 let entry = dart.as(next, E); | 2475 let entry = dart.as(next, E); |
2373 next = entry._next; | 2476 next = entry[_next]; |
2374 entry._next = entry._previous = entry._list = null; | 2477 entry[_next] = entry[_previous] = entry[_list] = null; |
2375 } | 2478 } |
2376 this._next = this._previous = this; | 2479 this[_next] = this[_previous] = this; |
2377 this._length = 0; | 2480 this[_length] = 0; |
2378 } | 2481 } |
2379 get first() { | 2482 get first() { |
2380 if (core.identical(this._next, this)) { | 2483 if (core.identical(this[_next], this)) { |
2381 throw new core.StateError('No such element'); | 2484 throw new core.StateError('No such element'); |
2382 } | 2485 } |
2383 return dart.as(this._next, E); | 2486 return dart.as(this[_next], E); |
2384 } | 2487 } |
2385 get last() { | 2488 get last() { |
2386 if (core.identical(this._previous, this)) { | 2489 if (core.identical(this[_previous], this)) { |
2387 throw new core.StateError('No such element'); | 2490 throw new core.StateError('No such element'); |
2388 } | 2491 } |
2389 return dart.as(this._previous, E); | 2492 return dart.as(this[_previous], E); |
2390 } | 2493 } |
2391 get single() { | 2494 get single() { |
2392 if (core.identical(this._previous, this)) { | 2495 if (core.identical(this[_previous], this)) { |
2393 throw new core.StateError('No such element'); | 2496 throw new core.StateError('No such element'); |
2394 } | 2497 } |
2395 if (!dart.notNull(core.identical(this._previous, this._next))) { | 2498 if (!dart.notNull(core.identical(this[_previous], this[_next]))) { |
2396 throw new core.StateError('Too many elements'); | 2499 throw new core.StateError('Too many elements'); |
2397 } | 2500 } |
2398 return dart.as(this._next, E); | 2501 return dart.as(this[_next], E); |
2399 } | 2502 } |
2400 forEach(action) { | 2503 forEach(action) { |
2401 let modificationCount = this._modificationCount; | 2504 let modificationCount = this[_modificationCount]; |
2402 let current = this._next; | 2505 let current = this[_next]; |
2403 while (!dart.notNull(core.identical(current, this))) { | 2506 while (!dart.notNull(core.identical(current, this))) { |
2404 action(dart.as(current, E)); | 2507 action(dart.as(current, E)); |
2405 if (modificationCount !== this._modificationCount) { | 2508 if (modificationCount !== this[_modificationCount]) { |
2406 throw new core.ConcurrentModificationError(this); | 2509 throw new core.ConcurrentModificationError(this); |
2407 } | 2510 } |
2408 current = current._next; | 2511 current = current[_next]; |
2409 } | 2512 } |
2410 } | 2513 } |
2411 get isEmpty() { | 2514 get isEmpty() { |
2412 return this._length === 0; | 2515 return this[_length] === 0; |
2413 } | 2516 } |
2414 _insertAfter(entry, newEntry) { | 2517 [_insertAfter](entry, newEntry) { |
2415 if (newEntry.list !== null) { | 2518 if (newEntry.list !== null) { |
2416 throw new core.StateError('LinkedListEntry is already in a LinkedList'
); | 2519 throw new core.StateError('LinkedListEntry is already in a LinkedList'
); |
2417 } | 2520 } |
2418 this._modificationCount++; | 2521 this[_modificationCount]++; |
2419 newEntry._list = this; | 2522 newEntry[_list] = this; |
2420 let predecessor = entry; | 2523 let predecessor = entry; |
2421 let successor = entry._next; | 2524 let successor = entry[_next]; |
2422 successor._previous = newEntry; | 2525 successor[_previous] = newEntry; |
2423 newEntry._previous = predecessor; | 2526 newEntry[_previous] = predecessor; |
2424 newEntry._next = successor; | 2527 newEntry[_next] = successor; |
2425 predecessor._next = newEntry; | 2528 predecessor[_next] = newEntry; |
2426 this._length++; | 2529 this[_length]++; |
2427 } | 2530 } |
2428 _unlink(entry) { | 2531 [_unlink](entry) { |
2429 this._modificationCount++; | 2532 this[_modificationCount]++; |
2430 entry._next._previous = entry._previous; | 2533 entry[_next][_previous] = entry[_previous]; |
2431 entry._previous._next = entry._next; | 2534 entry[_previous][_next] = entry[_next]; |
2432 this._length--; | 2535 this[_length]--; |
2433 entry._list = entry._next = entry._previous = null; | 2536 entry[_list] = entry[_next] = entry[_previous] = null; |
2434 } | 2537 } |
2435 } | 2538 } |
2436 return LinkedList; | 2539 return LinkedList; |
2437 }); | 2540 }); |
2438 let LinkedList = LinkedList$(dynamic); | 2541 let LinkedList = LinkedList$(dynamic); |
2439 let _LinkedListIterator$ = dart.generic(function(E) { | 2542 let _LinkedListIterator$ = dart.generic(function(E) { |
2440 class _LinkedListIterator extends dart.Object { | 2543 class _LinkedListIterator extends dart.Object { |
2441 _LinkedListIterator(list) { | 2544 _LinkedListIterator(list) { |
2442 this._list = list; | 2545 this[_list] = list; |
2443 this._modificationCount = list._modificationCount; | 2546 this[_modificationCount] = list[_modificationCount]; |
2444 this._next = list._next; | 2547 this[_next] = list[_next]; |
2445 this._current = null; | 2548 this[_current] = null; |
2446 } | 2549 } |
2447 get current() { | 2550 get current() { |
2448 return this._current; | 2551 return this[_current]; |
2449 } | 2552 } |
2450 moveNext() { | 2553 moveNext() { |
2451 if (core.identical(this._next, this._list)) { | 2554 if (core.identical(this[_next], this[_list])) { |
2452 this._current = null; | 2555 this[_current] = null; |
2453 return false; | 2556 return false; |
2454 } | 2557 } |
2455 if (this._modificationCount !== this._list._modificationCount) { | 2558 if (this[_modificationCount] !== this[_list][_modificationCount]) { |
2456 throw new core.ConcurrentModificationError(this); | 2559 throw new core.ConcurrentModificationError(this); |
2457 } | 2560 } |
2458 this._current = dart.as(this._next, E); | 2561 this[_current] = dart.as(this[_next], E); |
2459 this._next = this._next._next; | 2562 this[_next] = this[_next][_next]; |
2460 return true; | 2563 return true; |
2461 } | 2564 } |
2462 } | 2565 } |
2463 return _LinkedListIterator; | 2566 return _LinkedListIterator; |
2464 }); | 2567 }); |
2465 let _LinkedListIterator = _LinkedListIterator$(dynamic); | 2568 let _LinkedListIterator = _LinkedListIterator$(dynamic); |
2466 class _LinkedListLink extends dart.Object { | 2569 class _LinkedListLink extends dart.Object { |
2467 _LinkedListLink() { | 2570 _LinkedListLink() { |
2468 this._next = null; | 2571 this[_next] = null; |
2469 this._previous = null; | 2572 this[_previous] = null; |
2470 } | 2573 } |
2471 } | 2574 } |
2472 let LinkedListEntry$ = dart.generic(function(E) { | 2575 let LinkedListEntry$ = dart.generic(function(E) { |
2473 class LinkedListEntry extends dart.Object { | 2576 class LinkedListEntry extends dart.Object { |
2474 LinkedListEntry() { | 2577 LinkedListEntry() { |
2475 this._list = null; | 2578 this[_list] = null; |
2476 this._next = null; | 2579 this[_next] = null; |
2477 this._previous = null; | 2580 this[_previous] = null; |
2478 } | 2581 } |
2479 get list() { | 2582 get list() { |
2480 return this._list; | 2583 return this[_list]; |
2481 } | 2584 } |
2482 unlink() { | 2585 unlink() { |
2483 this._list._unlink(this); | 2586 this[_list]._unlink(this); |
2484 } | 2587 } |
2485 get next() { | 2588 get next() { |
2486 if (core.identical(this._next, this._list)) | 2589 if (core.identical(this[_next], this[_list])) |
2487 return null; | 2590 return null; |
2488 let result = dart.as(this._next, E); | 2591 let result = dart.as(this[_next], E); |
2489 return result; | 2592 return result; |
2490 } | 2593 } |
2491 get previous() { | 2594 get previous() { |
2492 if (core.identical(this._previous, this._list)) | 2595 if (core.identical(this[_previous], this[_list])) |
2493 return null; | 2596 return null; |
2494 return dart.as(this._previous, E); | 2597 return dart.as(this[_previous], E); |
2495 } | 2598 } |
2496 insertAfter(entry) { | 2599 insertAfter(entry) { |
2497 this._list._insertAfter(this, entry); | 2600 this[_list]._insertAfter(this, entry); |
2498 } | 2601 } |
2499 insertBefore(entry) { | 2602 insertBefore(entry) { |
2500 this._list._insertAfter(this._previous, entry); | 2603 this[_list]._insertAfter(this[_previous], entry); |
2501 } | 2604 } |
2502 } | 2605 } |
2503 return LinkedListEntry; | 2606 return LinkedListEntry; |
2504 }); | 2607 }); |
2505 let LinkedListEntry = LinkedListEntry$(dynamic); | 2608 let LinkedListEntry = LinkedListEntry$(dynamic); |
2506 let ListBase$ = dart.generic(function(E) { | 2609 let ListBase$ = dart.generic(function(E) { |
2507 class ListBase extends dart.mixin(core.Object, ListMixin$(E)) { | 2610 class ListBase extends dart.mixin(core.Object, ListMixin$(E)) { |
2508 static listToString(list) { | 2611 static listToString(list) { |
2509 return IterableBase.iterableToFullString(list, '[', ']'); | 2612 return IterableBase.iterableToFullString(list, '[', ']'); |
2510 } | 2613 } |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2730 } | 2833 } |
2731 } | 2834 } |
2732 return false; | 2835 return false; |
2733 } | 2836 } |
2734 removeWhere(test) { | 2837 removeWhere(test) { |
2735 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) →
bool")), false); | 2838 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) →
bool")), false); |
2736 } | 2839 } |
2737 retainWhere(test) { | 2840 retainWhere(test) { |
2738 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) →
bool")), true); | 2841 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) →
bool")), true); |
2739 } | 2842 } |
2740 static _filter(source, test, retainMatching) { | 2843 static [_filter](source, test, retainMatching) { |
2741 let retained = new List.from([]); | 2844 let retained = new List.from([]); |
2742 let length = source.length; | 2845 let length = source.length; |
2743 for (let i = 0; i < length; i++) { | 2846 for (let i = 0; i < length; i++) { |
2744 let element = source.get(i); | 2847 let element = source.get(i); |
2745 if (test(element) === retainMatching) { | 2848 if (test(element) === retainMatching) { |
2746 retained.add(element); | 2849 retained.add(element); |
2747 } | 2850 } |
2748 if (length !== source.length) { | 2851 if (length !== source.length) { |
2749 throw new core.ConcurrentModificationError(source); | 2852 throw new core.ConcurrentModificationError(source); |
2750 } | 2853 } |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3016 }); | 3119 }); |
3017 let MapMixin = MapMixin$(dynamic, dynamic); | 3120 let MapMixin = MapMixin$(dynamic, dynamic); |
3018 let UnmodifiableMapBase$ = dart.generic(function(K, V) { | 3121 let UnmodifiableMapBase$ = dart.generic(function(K, V) { |
3019 class UnmodifiableMapBase extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { | 3122 class UnmodifiableMapBase extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { |
3020 } | 3123 } |
3021 return UnmodifiableMapBase; | 3124 return UnmodifiableMapBase; |
3022 }); | 3125 }); |
3023 let UnmodifiableMapBase = UnmodifiableMapBase$(dynamic, dynamic); | 3126 let UnmodifiableMapBase = UnmodifiableMapBase$(dynamic, dynamic); |
3024 let _MapBaseValueIterable$ = dart.generic(function(V) { | 3127 let _MapBaseValueIterable$ = dart.generic(function(V) { |
3025 class _MapBaseValueIterable extends IterableBase$(V) { | 3128 class _MapBaseValueIterable extends IterableBase$(V) { |
3026 _MapBaseValueIterable(_map) { | 3129 _MapBaseValueIterable($_map) { |
3027 this._map = _map; | 3130 this[_map] = $_map; |
3028 super.IterableBase(); | 3131 super.IterableBase(); |
3029 } | 3132 } |
3030 get length() { | 3133 get length() { |
3031 return this._map.length; | 3134 return this[_map].length; |
3032 } | 3135 } |
3033 get isEmpty() { | 3136 get isEmpty() { |
3034 return this._map.isEmpty; | 3137 return this[_map].isEmpty; |
3035 } | 3138 } |
3036 get isNotEmpty() { | 3139 get isNotEmpty() { |
3037 return this._map.isNotEmpty; | 3140 return this[_map].isNotEmpty; |
3038 } | 3141 } |
3039 get first() { | 3142 get first() { |
3040 return dart.as(this._map.get(this._map.keys.first), V); | 3143 return dart.as(this[_map].get(this[_map].keys.first), V); |
3041 } | 3144 } |
3042 get single() { | 3145 get single() { |
3043 return dart.as(this._map.get(this._map.keys.single), V); | 3146 return dart.as(this[_map].get(this[_map].keys.single), V); |
3044 } | 3147 } |
3045 get last() { | 3148 get last() { |
3046 return dart.as(this._map.get(this._map.keys.last), V); | 3149 return dart.as(this[_map].get(this[_map].keys.last), V); |
3047 } | 3150 } |
3048 get iterator() { | 3151 get iterator() { |
3049 return new _MapBaseValueIterator(this._map); | 3152 return new _MapBaseValueIterator(this[_map]); |
3050 } | 3153 } |
3051 } | 3154 } |
3052 return _MapBaseValueIterable; | 3155 return _MapBaseValueIterable; |
3053 }); | 3156 }); |
3054 let _MapBaseValueIterable = _MapBaseValueIterable$(dynamic); | 3157 let _MapBaseValueIterable = _MapBaseValueIterable$(dynamic); |
3055 let _MapBaseValueIterator$ = dart.generic(function(V) { | 3158 let _MapBaseValueIterator$ = dart.generic(function(V) { |
3056 class _MapBaseValueIterator extends dart.Object { | 3159 class _MapBaseValueIterator extends dart.Object { |
3057 _MapBaseValueIterator(map) { | 3160 _MapBaseValueIterator(map) { |
3058 this._map = map; | 3161 this[_map] = map; |
3059 this._keys = map.keys.iterator; | 3162 this[_keys] = map.keys.iterator; |
3060 this._current = dart.as(null, V); | 3163 this[_current] = dart.as(null, V); |
3061 } | 3164 } |
3062 moveNext() { | 3165 moveNext() { |
3063 if (this._keys.moveNext()) { | 3166 if (this[_keys].moveNext()) { |
3064 this._current = dart.as(this._map.get(this._keys.current), V); | 3167 this[_current] = dart.as(this[_map].get(this[_keys].current), V); |
3065 return true; | 3168 return true; |
3066 } | 3169 } |
3067 this._current = dart.as(null, V); | 3170 this[_current] = dart.as(null, V); |
3068 return false; | 3171 return false; |
3069 } | 3172 } |
3070 get current() { | 3173 get current() { |
3071 return this._current; | 3174 return this[_current]; |
3072 } | 3175 } |
3073 } | 3176 } |
3074 return _MapBaseValueIterator; | 3177 return _MapBaseValueIterator; |
3075 }); | 3178 }); |
3076 let _MapBaseValueIterator = _MapBaseValueIterator$(dynamic); | 3179 let _MapBaseValueIterator = _MapBaseValueIterator$(dynamic); |
3077 let _UnmodifiableMapMixin$ = dart.generic(function(K, V) { | 3180 let _UnmodifiableMapMixin$ = dart.generic(function(K, V) { |
3078 class _UnmodifiableMapMixin extends dart.Object { | 3181 class _UnmodifiableMapMixin extends dart.Object { |
3079 set(key, value) { | 3182 set(key, value) { |
3080 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 3183 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
3081 } | 3184 } |
3082 addAll(other) { | 3185 addAll(other) { |
3083 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 3186 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
3084 } | 3187 } |
3085 clear() { | 3188 clear() { |
3086 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 3189 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
3087 } | 3190 } |
3088 remove(key) { | 3191 remove(key) { |
3089 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 3192 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
3090 } | 3193 } |
3091 putIfAbsent(key, ifAbsent) { | 3194 putIfAbsent(key, ifAbsent) { |
3092 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 3195 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
3093 } | 3196 } |
3094 } | 3197 } |
3095 return _UnmodifiableMapMixin; | 3198 return _UnmodifiableMapMixin; |
3096 }); | 3199 }); |
3097 let _UnmodifiableMapMixin = _UnmodifiableMapMixin$(dynamic, dynamic); | 3200 let _UnmodifiableMapMixin = _UnmodifiableMapMixin$(dynamic, dynamic); |
3098 let MapView$ = dart.generic(function(K, V) { | 3201 let MapView$ = dart.generic(function(K, V) { |
3099 class MapView extends dart.Object { | 3202 class MapView extends dart.Object { |
3100 MapView(map) { | 3203 MapView(map) { |
3101 this._map = map; | 3204 this[_map] = map; |
3102 } | 3205 } |
3103 get(key) { | 3206 get(key) { |
3104 return this._map.get(key); | 3207 return this[_map].get(key); |
3105 } | 3208 } |
3106 set(key, value) { | 3209 set(key, value) { |
3107 this._map.set(key, value); | 3210 this[_map].set(key, value); |
3108 } | 3211 } |
3109 addAll(other) { | 3212 addAll(other) { |
3110 this._map.addAll(other); | 3213 this[_map].addAll(other); |
3111 } | 3214 } |
3112 clear() { | 3215 clear() { |
3113 this._map.clear(); | 3216 this[_map].clear(); |
3114 } | 3217 } |
3115 putIfAbsent(key, ifAbsent) { | 3218 putIfAbsent(key, ifAbsent) { |
3116 return this._map.putIfAbsent(key, ifAbsent); | 3219 return this[_map].putIfAbsent(key, ifAbsent); |
3117 } | 3220 } |
3118 containsKey(key) { | 3221 containsKey(key) { |
3119 return this._map.containsKey(key); | 3222 return this[_map].containsKey(key); |
3120 } | 3223 } |
3121 containsValue(value) { | 3224 containsValue(value) { |
3122 return this._map.containsValue(value); | 3225 return this[_map].containsValue(value); |
3123 } | 3226 } |
3124 forEach(action) { | 3227 forEach(action) { |
3125 this._map.forEach(action); | 3228 this[_map].forEach(action); |
3126 } | 3229 } |
3127 get isEmpty() { | 3230 get isEmpty() { |
3128 return this._map.isEmpty; | 3231 return this[_map].isEmpty; |
3129 } | 3232 } |
3130 get isNotEmpty() { | 3233 get isNotEmpty() { |
3131 return this._map.isNotEmpty; | 3234 return this[_map].isNotEmpty; |
3132 } | 3235 } |
3133 get length() { | 3236 get length() { |
3134 return this._map.length; | 3237 return this[_map].length; |
3135 } | 3238 } |
3136 get keys() { | 3239 get keys() { |
3137 return this._map.keys; | 3240 return this[_map].keys; |
3138 } | 3241 } |
3139 remove(key) { | 3242 remove(key) { |
3140 return this._map.remove(key); | 3243 return this[_map].remove(key); |
3141 } | 3244 } |
3142 toString() { | 3245 toString() { |
3143 return this._map.toString(); | 3246 return this[_map].toString(); |
3144 } | 3247 } |
3145 get values() { | 3248 get values() { |
3146 return this._map.values; | 3249 return this[_map].values; |
3147 } | 3250 } |
3148 } | 3251 } |
3149 return MapView; | 3252 return MapView; |
3150 }); | 3253 }); |
3151 let MapView = MapView$(dynamic, dynamic); | 3254 let MapView = MapView$(dynamic, dynamic); |
3152 let UnmodifiableMapView$ = dart.generic(function(K, V) { | 3255 let UnmodifiableMapView$ = dart.generic(function(K, V) { |
3153 class UnmodifiableMapView extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { | 3256 class UnmodifiableMapView extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { |
3154 } | 3257 } |
3155 return UnmodifiableMapView; | 3258 return UnmodifiableMapView; |
3156 }); | 3259 }); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3201 } | 3304 } |
3202 static isNotEmpty(map) { | 3305 static isNotEmpty(map) { |
3203 return map.keys.isNotEmpty; | 3306 return map.keys.isNotEmpty; |
3204 } | 3307 } |
3205 static mapToString(m) { | 3308 static mapToString(m) { |
3206 if (IterableBase._isToStringVisiting(m)) { | 3309 if (IterableBase._isToStringVisiting(m)) { |
3207 return '{...}'; | 3310 return '{...}'; |
3208 } | 3311 } |
3209 let result = new core.StringBuffer(); | 3312 let result = new core.StringBuffer(); |
3210 try { | 3313 try { |
3211 IterableBase._toStringVisiting.add(m); | 3314 IterableBase[_toStringVisiting].add(m); |
3212 result.write('{'); | 3315 result.write('{'); |
3213 let first = true; | 3316 let first = true; |
3214 m.forEach(((k, v) => { | 3317 m.forEach(((k, v) => { |
3215 if (!dart.notNull(first)) { | 3318 if (!dart.notNull(first)) { |
3216 result.write(', '); | 3319 result.write(', '); |
3217 } | 3320 } |
3218 first = false; | 3321 first = false; |
3219 result.write(k); | 3322 result.write(k); |
3220 result.write(': '); | 3323 result.write(': '); |
3221 result.write(v); | 3324 result.write(v); |
3222 }).bind(this)); | 3325 }).bind(this)); |
3223 result.write('}'); | 3326 result.write('}'); |
3224 } finally { | 3327 } finally { |
3225 dart.assert(core.identical(IterableBase._toStringVisiting.last, m)); | 3328 dart.assert(core.identical(IterableBase[_toStringVisiting].last, m)); |
3226 IterableBase._toStringVisiting.removeLast(); | 3329 IterableBase[_toStringVisiting].removeLast(); |
3227 } | 3330 } |
3228 return result.toString(); | 3331 return result.toString(); |
3229 } | 3332 } |
3230 static _id(x) { | 3333 static [_id](x) { |
3231 return x; | 3334 return x; |
3232 } | 3335 } |
3233 static _fillMapWithMappedIterable(map, iterable, key, value) { | 3336 static [_fillMapWithMappedIterable](map, iterable, key, value) { |
3234 if (key === null) | 3337 if (key === null) |
3235 key = _id; | 3338 key = _id; |
3236 if (value === null) | 3339 if (value === null) |
3237 value = _id; | 3340 value = _id; |
3238 for (let element of iterable) { | 3341 for (let element of iterable) { |
3239 map.set(key(element), value(element)); | 3342 map.set(key(element), value(element)); |
3240 } | 3343 } |
3241 } | 3344 } |
3242 static _fillMapWithIterables(map, keys, values) { | 3345 static [_fillMapWithIterables](map, keys, values) { |
3243 let keyIterator = keys.iterator; | 3346 let keyIterator = keys.iterator; |
3244 let valueIterator = values.iterator; | 3347 let valueIterator = values.iterator; |
3245 let hasNextKey = keyIterator.moveNext(); | 3348 let hasNextKey = keyIterator.moveNext(); |
3246 let hasNextValue = valueIterator.moveNext(); | 3349 let hasNextValue = valueIterator.moveNext(); |
3247 while (dart.notNull(hasNextKey) && dart.notNull(hasNextValue)) { | 3350 while (dart.notNull(hasNextKey) && dart.notNull(hasNextValue)) { |
3248 map.set(keyIterator.current, valueIterator.current); | 3351 map.set(keyIterator.current, valueIterator.current); |
3249 hasNextKey = keyIterator.moveNext(); | 3352 hasNextKey = keyIterator.moveNext(); |
3250 hasNextValue = valueIterator.moveNext(); | 3353 hasNextValue = valueIterator.moveNext(); |
3251 } | 3354 } |
3252 if (dart.notNull(hasNextKey) || dart.notNull(hasNextValue)) { | 3355 if (dart.notNull(hasNextKey) || dart.notNull(hasNextValue)) { |
(...skipping 10 matching lines...) Expand all Loading... |
3263 return new ListQueue.from(elements); | 3366 return new ListQueue.from(elements); |
3264 } | 3367 } |
3265 } | 3368 } |
3266 dart.defineNamedConstructor(Queue, 'from'); | 3369 dart.defineNamedConstructor(Queue, 'from'); |
3267 return Queue; | 3370 return Queue; |
3268 }); | 3371 }); |
3269 let Queue = Queue$(dynamic); | 3372 let Queue = Queue$(dynamic); |
3270 let DoubleLinkedQueueEntry$ = dart.generic(function(E) { | 3373 let DoubleLinkedQueueEntry$ = dart.generic(function(E) { |
3271 class DoubleLinkedQueueEntry extends dart.Object { | 3374 class DoubleLinkedQueueEntry extends dart.Object { |
3272 DoubleLinkedQueueEntry(e) { | 3375 DoubleLinkedQueueEntry(e) { |
3273 this._element = e; | 3376 this[_element] = e; |
3274 this._previous = null; | 3377 this[_previous] = null; |
3275 this._next = null; | 3378 this[_next] = null; |
3276 } | 3379 } |
3277 _link(previous, next) { | 3380 [_link](previous, next) { |
3278 this._next = next; | 3381 this[_next] = next; |
3279 this._previous = previous; | 3382 this[_previous] = previous; |
3280 previous._next = this; | 3383 previous[_next] = this; |
3281 next._previous = this; | 3384 next[_previous] = this; |
3282 } | 3385 } |
3283 append(e) { | 3386 append(e) { |
3284 new DoubleLinkedQueueEntry(e)._link(this, this._next); | 3387 new DoubleLinkedQueueEntry(e)._link(this, this[_next]); |
3285 } | 3388 } |
3286 prepend(e) { | 3389 prepend(e) { |
3287 new DoubleLinkedQueueEntry(e)._link(this._previous, this); | 3390 new DoubleLinkedQueueEntry(e)._link(this[_previous], this); |
3288 } | 3391 } |
3289 remove() { | 3392 remove() { |
3290 this._previous._next = this._next; | 3393 this[_previous][_next] = this[_next]; |
3291 this._next._previous = this._previous; | 3394 this[_next][_previous] = this[_previous]; |
3292 this._next = null; | 3395 this[_next] = null; |
3293 this._previous = null; | 3396 this[_previous] = null; |
3294 return this._element; | 3397 return this[_element]; |
3295 } | 3398 } |
3296 _asNonSentinelEntry() { | 3399 [_asNonSentinelEntry]() { |
3297 return this; | 3400 return this; |
3298 } | 3401 } |
3299 previousEntry() { | 3402 previousEntry() { |
3300 return this._previous._asNonSentinelEntry(); | 3403 return this[_previous]._asNonSentinelEntry(); |
3301 } | 3404 } |
3302 nextEntry() { | 3405 nextEntry() { |
3303 return this._next._asNonSentinelEntry(); | 3406 return this[_next]._asNonSentinelEntry(); |
3304 } | 3407 } |
3305 get element() { | 3408 get element() { |
3306 return this._element; | 3409 return this[_element]; |
3307 } | 3410 } |
3308 set element(e) { | 3411 set element(e) { |
3309 this._element = e; | 3412 this[_element] = e; |
3310 } | 3413 } |
3311 } | 3414 } |
3312 return DoubleLinkedQueueEntry; | 3415 return DoubleLinkedQueueEntry; |
3313 }); | 3416 }); |
3314 let DoubleLinkedQueueEntry = DoubleLinkedQueueEntry$(dynamic); | 3417 let DoubleLinkedQueueEntry = DoubleLinkedQueueEntry$(dynamic); |
3315 let _DoubleLinkedQueueEntrySentinel$ = dart.generic(function(E) { | 3418 let _DoubleLinkedQueueEntrySentinel$ = dart.generic(function(E) { |
3316 class _DoubleLinkedQueueEntrySentinel extends DoubleLinkedQueueEntry$(E) { | 3419 class _DoubleLinkedQueueEntrySentinel extends DoubleLinkedQueueEntry$(E) { |
3317 _DoubleLinkedQueueEntrySentinel() { | 3420 _DoubleLinkedQueueEntrySentinel() { |
3318 super.DoubleLinkedQueueEntry(dart.as(null, E)); | 3421 super.DoubleLinkedQueueEntry(dart.as(null, E)); |
3319 this._link(this, this); | 3422 this[_link](this, this); |
3320 } | 3423 } |
3321 remove() { | 3424 remove() { |
3322 throw _internal.IterableElementError.noElement(); | 3425 throw _internal.IterableElementError.noElement(); |
3323 } | 3426 } |
3324 _asNonSentinelEntry() { | 3427 [_asNonSentinelEntry]() { |
3325 return null; | 3428 return null; |
3326 } | 3429 } |
3327 set element(e) { | 3430 set element(e) { |
3328 dart.assert(false); | 3431 dart.assert(false); |
3329 } | 3432 } |
3330 get element() { | 3433 get element() { |
3331 throw _internal.IterableElementError.noElement(); | 3434 throw _internal.IterableElementError.noElement(); |
3332 } | 3435 } |
3333 } | 3436 } |
3334 return _DoubleLinkedQueueEntrySentinel; | 3437 return _DoubleLinkedQueueEntrySentinel; |
3335 }); | 3438 }); |
3336 let _DoubleLinkedQueueEntrySentinel = _DoubleLinkedQueueEntrySentinel$(dynamic
); | 3439 let _DoubleLinkedQueueEntrySentinel = _DoubleLinkedQueueEntrySentinel$(dynamic
); |
3337 let DoubleLinkedQueue$ = dart.generic(function(E) { | 3440 let DoubleLinkedQueue$ = dart.generic(function(E) { |
3338 class DoubleLinkedQueue extends IterableBase$(E) { | 3441 class DoubleLinkedQueue extends IterableBase$(E) { |
3339 DoubleLinkedQueue() { | 3442 DoubleLinkedQueue() { |
3340 this._sentinel = null; | 3443 this[_sentinel] = null; |
3341 this._elementCount = 0; | 3444 this[_elementCount] = 0; |
3342 super.IterableBase(); | 3445 super.IterableBase(); |
3343 this._sentinel = new _DoubleLinkedQueueEntrySentinel(); | 3446 this[_sentinel] = new _DoubleLinkedQueueEntrySentinel(); |
3344 } | 3447 } |
3345 DoubleLinkedQueue$from(elements) { | 3448 DoubleLinkedQueue$from(elements) { |
3346 let list = dart.as(new DoubleLinkedQueue(), Queue$(E)); | 3449 let list = dart.as(new DoubleLinkedQueue(), Queue$(E)); |
3347 for (let e of elements) { | 3450 for (let e of elements) { |
3348 list.addLast(e); | 3451 list.addLast(e); |
3349 } | 3452 } |
3350 return dart.as(list, DoubleLinkedQueue$(E)); | 3453 return dart.as(list, DoubleLinkedQueue$(E)); |
3351 } | 3454 } |
3352 get length() { | 3455 get length() { |
3353 return this._elementCount; | 3456 return this[_elementCount]; |
3354 } | 3457 } |
3355 addLast(value) { | 3458 addLast(value) { |
3356 this._sentinel.prepend(value); | 3459 this[_sentinel].prepend(value); |
3357 this._elementCount++; | 3460 this[_elementCount]++; |
3358 } | 3461 } |
3359 addFirst(value) { | 3462 addFirst(value) { |
3360 this._sentinel.append(value); | 3463 this[_sentinel].append(value); |
3361 this._elementCount++; | 3464 this[_elementCount]++; |
3362 } | 3465 } |
3363 add(value) { | 3466 add(value) { |
3364 this._sentinel.prepend(value); | 3467 this[_sentinel].prepend(value); |
3365 this._elementCount++; | 3468 this[_elementCount]++; |
3366 } | 3469 } |
3367 addAll(iterable) { | 3470 addAll(iterable) { |
3368 for (let value of iterable) { | 3471 for (let value of iterable) { |
3369 this._sentinel.prepend(value); | 3472 this[_sentinel].prepend(value); |
3370 this._elementCount++; | 3473 this[_elementCount]++; |
3371 } | 3474 } |
3372 } | 3475 } |
3373 removeLast() { | 3476 removeLast() { |
3374 let result = this._sentinel._previous.remove(); | 3477 let result = this[_sentinel][_previous].remove(); |
3375 this._elementCount--; | 3478 this[_elementCount]--; |
3376 return result; | 3479 return result; |
3377 } | 3480 } |
3378 removeFirst() { | 3481 removeFirst() { |
3379 let result = this._sentinel._next.remove(); | 3482 let result = this[_sentinel][_next].remove(); |
3380 this._elementCount--; | 3483 this[_elementCount]--; |
3381 return result; | 3484 return result; |
3382 } | 3485 } |
3383 remove(o) { | 3486 remove(o) { |
3384 let entry = this._sentinel._next; | 3487 let entry = this[_sentinel][_next]; |
3385 while (!dart.notNull(core.identical(entry, this._sentinel))) { | 3488 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { |
3386 if (dart.equals(entry.element, o)) { | 3489 if (dart.equals(entry.element, o)) { |
3387 entry.remove(); | 3490 entry.remove(); |
3388 this._elementCount--; | 3491 this[_elementCount]--; |
3389 return true; | 3492 return true; |
3390 } | 3493 } |
3391 entry = entry._next; | 3494 entry = entry[_next]; |
3392 } | 3495 } |
3393 return false; | 3496 return false; |
3394 } | 3497 } |
3395 _filter(test, removeMatching) { | 3498 [_filter](test, removeMatching) { |
3396 let entry = this._sentinel._next; | 3499 let entry = this[_sentinel][_next]; |
3397 while (!dart.notNull(core.identical(entry, this._sentinel))) { | 3500 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { |
3398 let next = entry._next; | 3501 let next = entry[_next]; |
3399 if (core.identical(removeMatching, test(entry.element))) { | 3502 if (core.identical(removeMatching, test(entry.element))) { |
3400 entry.remove(); | 3503 entry.remove(); |
3401 this._elementCount--; | 3504 this[_elementCount]--; |
3402 } | 3505 } |
3403 entry = next; | 3506 entry = next; |
3404 } | 3507 } |
3405 } | 3508 } |
3406 removeWhere(test) { | 3509 removeWhere(test) { |
3407 this._filter(test, true); | 3510 this[_filter](test, true); |
3408 } | 3511 } |
3409 retainWhere(test) { | 3512 retainWhere(test) { |
3410 this._filter(test, false); | 3513 this[_filter](test, false); |
3411 } | 3514 } |
3412 get first() { | 3515 get first() { |
3413 return this._sentinel._next.element; | 3516 return this[_sentinel][_next].element; |
3414 } | 3517 } |
3415 get last() { | 3518 get last() { |
3416 return this._sentinel._previous.element; | 3519 return this[_sentinel][_previous].element; |
3417 } | 3520 } |
3418 get single() { | 3521 get single() { |
3419 if (core.identical(this._sentinel._next, this._sentinel._previous)) { | 3522 if (core.identical(this[_sentinel][_next], this[_sentinel][_previous]))
{ |
3420 return this._sentinel._next.element; | 3523 return this[_sentinel][_next].element; |
3421 } | 3524 } |
3422 throw _internal.IterableElementError.tooMany(); | 3525 throw _internal.IterableElementError.tooMany(); |
3423 } | 3526 } |
3424 lastEntry() { | 3527 lastEntry() { |
3425 return this._sentinel.previousEntry(); | 3528 return this[_sentinel].previousEntry(); |
3426 } | 3529 } |
3427 firstEntry() { | 3530 firstEntry() { |
3428 return this._sentinel.nextEntry(); | 3531 return this[_sentinel].nextEntry(); |
3429 } | 3532 } |
3430 get isEmpty() { | 3533 get isEmpty() { |
3431 return core.identical(this._sentinel._next, this._sentinel); | 3534 return core.identical(this[_sentinel][_next], this[_sentinel]); |
3432 } | 3535 } |
3433 clear() { | 3536 clear() { |
3434 this._sentinel._next = this._sentinel; | 3537 this[_sentinel][_next] = this[_sentinel]; |
3435 this._sentinel._previous = this._sentinel; | 3538 this[_sentinel][_previous] = this[_sentinel]; |
3436 this._elementCount = 0; | 3539 this[_elementCount] = 0; |
3437 } | 3540 } |
3438 forEachEntry(f) { | 3541 forEachEntry(f) { |
3439 let entry = this._sentinel._next; | 3542 let entry = this[_sentinel][_next]; |
3440 while (!dart.notNull(core.identical(entry, this._sentinel))) { | 3543 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { |
3441 let nextEntry = entry._next; | 3544 let nextEntry = entry[_next]; |
3442 f(entry); | 3545 f(entry); |
3443 entry = nextEntry; | 3546 entry = nextEntry; |
3444 } | 3547 } |
3445 } | 3548 } |
3446 get iterator() { | 3549 get iterator() { |
3447 return new _DoubleLinkedQueueIterator(this._sentinel); | 3550 return new _DoubleLinkedQueueIterator(this[_sentinel]); |
3448 } | 3551 } |
3449 toString() { | 3552 toString() { |
3450 return IterableBase.iterableToFullString(this, '{', '}'); | 3553 return IterableBase.iterableToFullString(this, '{', '}'); |
3451 } | 3554 } |
3452 } | 3555 } |
3453 dart.defineNamedConstructor(DoubleLinkedQueue, 'from'); | 3556 dart.defineNamedConstructor(DoubleLinkedQueue, 'from'); |
3454 return DoubleLinkedQueue; | 3557 return DoubleLinkedQueue; |
3455 }); | 3558 }); |
3456 let DoubleLinkedQueue = DoubleLinkedQueue$(dynamic); | 3559 let DoubleLinkedQueue = DoubleLinkedQueue$(dynamic); |
3457 let _DoubleLinkedQueueIterator$ = dart.generic(function(E) { | 3560 let _DoubleLinkedQueueIterator$ = dart.generic(function(E) { |
3458 class _DoubleLinkedQueueIterator extends dart.Object { | 3561 class _DoubleLinkedQueueIterator extends dart.Object { |
3459 _DoubleLinkedQueueIterator(sentinel) { | 3562 _DoubleLinkedQueueIterator(sentinel) { |
3460 this._sentinel = sentinel; | 3563 this[_sentinel] = sentinel; |
3461 this._nextEntry = sentinel._next; | 3564 this[_nextEntry] = sentinel[_next]; |
3462 this._current = dart.as(null, E); | 3565 this[_current] = dart.as(null, E); |
3463 } | 3566 } |
3464 moveNext() { | 3567 moveNext() { |
3465 if (!dart.notNull(core.identical(this._nextEntry, this._sentinel))) { | 3568 if (!dart.notNull(core.identical(this[_nextEntry], this[_sentinel]))) { |
3466 this._current = this._nextEntry._element; | 3569 this[_current] = this[_nextEntry][_element]; |
3467 this._nextEntry = this._nextEntry._next; | 3570 this[_nextEntry] = this[_nextEntry][_next]; |
3468 return true; | 3571 return true; |
3469 } | 3572 } |
3470 this._current = dart.as(null, E); | 3573 this[_current] = dart.as(null, E); |
3471 this._nextEntry = this._sentinel = null; | 3574 this[_nextEntry] = this[_sentinel] = null; |
3472 return false; | 3575 return false; |
3473 } | 3576 } |
3474 get current() { | 3577 get current() { |
3475 return this._current; | 3578 return this[_current]; |
3476 } | 3579 } |
3477 } | 3580 } |
3478 return _DoubleLinkedQueueIterator; | 3581 return _DoubleLinkedQueueIterator; |
3479 }); | 3582 }); |
3480 let _DoubleLinkedQueueIterator = _DoubleLinkedQueueIterator$(dynamic); | 3583 let _DoubleLinkedQueueIterator = _DoubleLinkedQueueIterator$(dynamic); |
3481 let ListQueue$ = dart.generic(function(E) { | 3584 let ListQueue$ = dart.generic(function(E) { |
3482 class ListQueue extends IterableBase$(E) { | 3585 class ListQueue extends IterableBase$(E) { |
3483 ListQueue(initialCapacity) { | 3586 ListQueue(initialCapacity) { |
3484 if (initialCapacity === void 0) | 3587 if (initialCapacity === void 0) |
3485 initialCapacity = null; | 3588 initialCapacity = null; |
3486 this._head = 0; | 3589 this[_head] = 0; |
3487 this._tail = 0; | 3590 this[_tail] = 0; |
3488 this._table = null; | 3591 this[_table] = null; |
3489 this._modificationCount = 0; | 3592 this[_modificationCount] = 0; |
3490 super.IterableBase(); | 3593 super.IterableBase(); |
3491 if (dart.notNull(initialCapacity === null) || dart.notNull(initialCapaci
ty < _INITIAL_CAPACITY)) { | 3594 if (dart.notNull(initialCapacity === null) || dart.notNull(initialCapaci
ty < _INITIAL_CAPACITY)) { |
3492 initialCapacity = _INITIAL_CAPACITY; | 3595 initialCapacity = _INITIAL_CAPACITY; |
3493 } else if (!dart.notNull(_isPowerOf2(initialCapacity))) { | 3596 } else if (!dart.notNull(_isPowerOf2(initialCapacity))) { |
3494 initialCapacity = _nextPowerOf2(initialCapacity); | 3597 initialCapacity = _nextPowerOf2(initialCapacity); |
3495 } | 3598 } |
3496 dart.assert(_isPowerOf2(initialCapacity)); | 3599 dart.assert(_isPowerOf2(initialCapacity)); |
3497 this._table = new core.List(initialCapacity); | 3600 this[_table] = new core.List(initialCapacity); |
3498 } | 3601 } |
3499 ListQueue$from(elements) { | 3602 ListQueue$from(elements) { |
3500 if (dart.is(elements, core.List)) { | 3603 if (dart.is(elements, core.List)) { |
3501 let length = elements.length; | 3604 let length = elements.length; |
3502 let queue = dart.as(new ListQueue(length + 1), ListQueue$(E)); | 3605 let queue = dart.as(new ListQueue(length + 1), ListQueue$(E)); |
3503 dart.assert(queue._table.length > length); | 3606 dart.assert(queue[_table].length > length); |
3504 let sourceList = elements; | 3607 let sourceList = elements; |
3505 queue._table.setRange(0, length, dart.as(sourceList, core.Iterable$(E)
), 0); | 3608 queue[_table].setRange(0, length, dart.as(sourceList, core.Iterable$(E
)), 0); |
3506 queue._tail = length; | 3609 queue[_tail] = length; |
3507 return queue; | 3610 return queue; |
3508 } else { | 3611 } else { |
3509 let capacity = _INITIAL_CAPACITY; | 3612 let capacity = _INITIAL_CAPACITY; |
3510 if (dart.is(elements, _internal.EfficientLength)) { | 3613 if (dart.is(elements, _internal.EfficientLength)) { |
3511 capacity = elements.length; | 3614 capacity = elements.length; |
3512 } | 3615 } |
3513 let result = new ListQueue(capacity); | 3616 let result = new ListQueue(capacity); |
3514 for (let element of elements) { | 3617 for (let element of elements) { |
3515 result.addLast(element); | 3618 result.addLast(element); |
3516 } | 3619 } |
3517 return result; | 3620 return result; |
3518 } | 3621 } |
3519 } | 3622 } |
3520 get iterator() { | 3623 get iterator() { |
3521 return new _ListQueueIterator(this); | 3624 return new _ListQueueIterator(this); |
3522 } | 3625 } |
3523 forEach(action) { | 3626 forEach(action) { |
3524 let modificationCount = this._modificationCount; | 3627 let modificationCount = this[_modificationCount]; |
3525 for (let i = this._head; i !== this._tail; i = i + 1 & this._table.lengt
h - 1) { | 3628 for (let i = this[_head]; i !== this[_tail]; i = i + 1 & this[_table].le
ngth - 1) { |
3526 action(this._table.get(i)); | 3629 action(this[_table].get(i)); |
3527 this._checkModification(modificationCount); | 3630 this[_checkModification](modificationCount); |
3528 } | 3631 } |
3529 } | 3632 } |
3530 get isEmpty() { | 3633 get isEmpty() { |
3531 return this._head === this._tail; | 3634 return this[_head] === this[_tail]; |
3532 } | 3635 } |
3533 get length() { | 3636 get length() { |
3534 return this._tail - this._head & this._table.length - 1; | 3637 return this[_tail] - this[_head] & this[_table].length - 1; |
3535 } | 3638 } |
3536 get first() { | 3639 get first() { |
3537 if (this._head === this._tail) | 3640 if (this[_head] === this[_tail]) |
3538 throw _internal.IterableElementError.noElement(); | 3641 throw _internal.IterableElementError.noElement(); |
3539 return this._table.get(this._head); | 3642 return this[_table].get(this[_head]); |
3540 } | 3643 } |
3541 get last() { | 3644 get last() { |
3542 if (this._head === this._tail) | 3645 if (this[_head] === this[_tail]) |
3543 throw _internal.IterableElementError.noElement(); | 3646 throw _internal.IterableElementError.noElement(); |
3544 return this._table.get(this._tail - 1 & this._table.length - 1); | 3647 return this[_table].get(this[_tail] - 1 & this[_table].length - 1); |
3545 } | 3648 } |
3546 get single() { | 3649 get single() { |
3547 if (this._head === this._tail) | 3650 if (this[_head] === this[_tail]) |
3548 throw _internal.IterableElementError.noElement(); | 3651 throw _internal.IterableElementError.noElement(); |
3549 if (this.length > 1) | 3652 if (this.length > 1) |
3550 throw _internal.IterableElementError.tooMany(); | 3653 throw _internal.IterableElementError.tooMany(); |
3551 return this._table.get(this._head); | 3654 return this[_table].get(this[_head]); |
3552 } | 3655 } |
3553 elementAt(index) { | 3656 elementAt(index) { |
3554 core.RangeError.checkValidIndex(index, this); | 3657 core.RangeError.checkValidIndex(index, this); |
3555 return this._table.get(this._head + index & this._table.length - 1); | 3658 return this[_table].get(this[_head] + index & this[_table].length - 1); |
3556 } | 3659 } |
3557 toList(opt$) { | 3660 toList(opt$) { |
3558 let growable = opt$.growable === void 0 ? true : opt$.growable; | 3661 let growable = opt$.growable === void 0 ? true : opt$.growable; |
3559 let list = null; | 3662 let list = null; |
3560 if (growable) { | 3663 if (growable) { |
3561 list = ((_) => { | 3664 list = ((_) => { |
3562 _.length = this.length; | 3665 _.length = this.length; |
3563 return _; | 3666 return _; |
3564 }).bind(this)(new core.List()); | 3667 }).bind(this)(new core.List()); |
3565 } else { | 3668 } else { |
3566 list = new core.List(this.length); | 3669 list = new core.List(this.length); |
3567 } | 3670 } |
3568 this._writeToList(list); | 3671 this[_writeToList](list); |
3569 return list; | 3672 return list; |
3570 } | 3673 } |
3571 add(element) { | 3674 add(element) { |
3572 this._add(element); | 3675 this[_add](element); |
3573 } | 3676 } |
3574 addAll(elements) { | 3677 addAll(elements) { |
3575 if (dart.is(elements, core.List)) { | 3678 if (dart.is(elements, core.List)) { |
3576 let list = dart.as(elements, core.List); | 3679 let list = dart.as(elements, core.List); |
3577 let addCount = list.length; | 3680 let addCount = list.length; |
3578 let length = this.length; | 3681 let length = this.length; |
3579 if (length + addCount >= this._table.length) { | 3682 if (length + addCount >= this[_table].length) { |
3580 this._preGrow(length + addCount); | 3683 this[_preGrow](length + addCount); |
3581 this._table.setRange(length, length + addCount, dart.as(list, core.I
terable$(E)), 0); | 3684 this[_table].setRange(length, length + addCount, dart.as(list, core.
Iterable$(E)), 0); |
3582 this._tail = addCount; | 3685 this[_tail] = addCount; |
3583 } else { | 3686 } else { |
3584 let endSpace = this._table.length - this._tail; | 3687 let endSpace = this[_table].length - this[_tail]; |
3585 if (addCount < endSpace) { | 3688 if (addCount < endSpace) { |
3586 this._table.setRange(this._tail, this._tail + addCount, dart.as(li
st, core.Iterable$(E)), 0); | 3689 this[_table].setRange(this[_tail], this[_tail] + addCount, dart.as
(list, core.Iterable$(E)), 0); |
3587 this._tail = addCount; | 3690 this[_tail] = addCount; |
3588 } else { | 3691 } else { |
3589 let preSpace = addCount - endSpace; | 3692 let preSpace = addCount - endSpace; |
3590 this._table.setRange(this._tail, this._tail + endSpace, dart.as(li
st, core.Iterable$(E)), 0); | 3693 this[_table].setRange(this[_tail], this[_tail] + endSpace, dart.as
(list, core.Iterable$(E)), 0); |
3591 this._table.setRange(0, preSpace, dart.as(list, core.Iterable$(E))
, endSpace); | 3694 this[_table].setRange(0, preSpace, dart.as(list, core.Iterable$(E)
), endSpace); |
3592 this._tail = preSpace; | 3695 this[_tail] = preSpace; |
3593 } | 3696 } |
3594 } | 3697 } |
3595 this._modificationCount++; | 3698 this[_modificationCount]++; |
3596 } else { | 3699 } else { |
3597 for (let element of elements) | 3700 for (let element of elements) |
3598 this._add(element); | 3701 this[_add](element); |
3599 } | 3702 } |
3600 } | 3703 } |
3601 remove(object) { | 3704 remove(object) { |
3602 for (let i = this._head; i !== this._tail; i = i + 1 & this._table.lengt
h - 1) { | 3705 for (let i = this[_head]; i !== this[_tail]; i = i + 1 & this[_table].le
ngth - 1) { |
3603 let element = this._table.get(i); | 3706 let element = this[_table].get(i); |
3604 if (dart.equals(element, object)) { | 3707 if (dart.equals(element, object)) { |
3605 this._remove(i); | 3708 this[_remove](i); |
3606 this._modificationCount++; | 3709 this[_modificationCount]++; |
3607 return true; | 3710 return true; |
3608 } | 3711 } |
3609 } | 3712 } |
3610 return false; | 3713 return false; |
3611 } | 3714 } |
3612 _filterWhere(test, removeMatching) { | 3715 [_filterWhere](test, removeMatching) { |
3613 let index = this._head; | 3716 let index = this[_head]; |
3614 let modificationCount = this._modificationCount; | 3717 let modificationCount = this[_modificationCount]; |
3615 let i = this._head; | 3718 let i = this[_head]; |
3616 while (i !== this._tail) { | 3719 while (i !== this[_tail]) { |
3617 let element = this._table.get(i); | 3720 let element = this[_table].get(i); |
3618 let remove = core.identical(removeMatching, test(element)); | 3721 let remove = core.identical(removeMatching, test(element)); |
3619 this._checkModification(modificationCount); | 3722 this[_checkModification](modificationCount); |
3620 if (remove) { | 3723 if (remove) { |
3621 i = this._remove(i); | 3724 i = this[_remove](i); |
3622 modificationCount = ++this._modificationCount; | 3725 modificationCount = ++this[_modificationCount]; |
3623 } else { | 3726 } else { |
3624 i = i + 1 & this._table.length - 1; | 3727 i = i + 1 & this[_table].length - 1; |
3625 } | 3728 } |
3626 } | 3729 } |
3627 } | 3730 } |
3628 removeWhere(test) { | 3731 removeWhere(test) { |
3629 this._filterWhere(test, true); | 3732 this[_filterWhere](test, true); |
3630 } | 3733 } |
3631 retainWhere(test) { | 3734 retainWhere(test) { |
3632 this._filterWhere(test, false); | 3735 this[_filterWhere](test, false); |
3633 } | 3736 } |
3634 clear() { | 3737 clear() { |
3635 if (this._head !== this._tail) { | 3738 if (this[_head] !== this[_tail]) { |
3636 for (let i = this._head; i !== this._tail; i = i + 1 & this._table.len
gth - 1) { | 3739 for (let i = this[_head]; i !== this[_tail]; i = i + 1 & this[_table].
length - 1) { |
3637 this._table.set(i, dart.as(null, E)); | 3740 this[_table].set(i, dart.as(null, E)); |
3638 } | 3741 } |
3639 this._head = this._tail = 0; | 3742 this[_head] = this[_tail] = 0; |
3640 this._modificationCount++; | 3743 this[_modificationCount]++; |
3641 } | 3744 } |
3642 } | 3745 } |
3643 toString() { | 3746 toString() { |
3644 return IterableBase.iterableToFullString(this, "{", "}"); | 3747 return IterableBase.iterableToFullString(this, "{", "}"); |
3645 } | 3748 } |
3646 addLast(element) { | 3749 addLast(element) { |
3647 this._add(element); | 3750 this[_add](element); |
3648 } | 3751 } |
3649 addFirst(element) { | 3752 addFirst(element) { |
3650 this._head = this._head - 1 & this._table.length - 1; | 3753 this[_head] = this[_head] - 1 & this[_table].length - 1; |
3651 this._table.set(this._head, element); | 3754 this[_table].set(this[_head], element); |
3652 if (this._head === this._tail) | 3755 if (this[_head] === this[_tail]) |
3653 this._grow(); | 3756 this[_grow](); |
3654 this._modificationCount++; | 3757 this[_modificationCount]++; |
3655 } | 3758 } |
3656 removeFirst() { | 3759 removeFirst() { |
3657 if (this._head === this._tail) | 3760 if (this[_head] === this[_tail]) |
3658 throw _internal.IterableElementError.noElement(); | 3761 throw _internal.IterableElementError.noElement(); |
3659 this._modificationCount++; | 3762 this[_modificationCount]++; |
3660 let result = this._table.get(this._head); | 3763 let result = this[_table].get(this[_head]); |
3661 this._table.set(this._head, dart.as(null, E)); | 3764 this[_table].set(this[_head], dart.as(null, E)); |
3662 this._head = this._head + 1 & this._table.length - 1; | 3765 this[_head] = this[_head] + 1 & this[_table].length - 1; |
3663 return result; | 3766 return result; |
3664 } | 3767 } |
3665 removeLast() { | 3768 removeLast() { |
3666 if (this._head === this._tail) | 3769 if (this[_head] === this[_tail]) |
3667 throw _internal.IterableElementError.noElement(); | 3770 throw _internal.IterableElementError.noElement(); |
3668 this._modificationCount++; | 3771 this[_modificationCount]++; |
3669 this._tail = this._tail - 1 & this._table.length - 1; | 3772 this[_tail] = this[_tail] - 1 & this[_table].length - 1; |
3670 let result = this._table.get(this._tail); | 3773 let result = this[_table].get(this[_tail]); |
3671 this._table.set(this._tail, dart.as(null, E)); | 3774 this[_table].set(this[_tail], dart.as(null, E)); |
3672 return result; | 3775 return result; |
3673 } | 3776 } |
3674 static _isPowerOf2(number) { | 3777 static [_isPowerOf2](number) { |
3675 return (number & number - 1) === 0; | 3778 return (number & number - 1) === 0; |
3676 } | 3779 } |
3677 static _nextPowerOf2(number) { | 3780 static [_nextPowerOf2](number) { |
3678 dart.assert(number > 0); | 3781 dart.assert(number > 0); |
3679 number = (number << 1) - 1; | 3782 number = (number << 1) - 1; |
3680 for (;;) { | 3783 for (;;) { |
3681 let nextNumber = number & number - 1; | 3784 let nextNumber = number & number - 1; |
3682 if (nextNumber === 0) | 3785 if (nextNumber === 0) |
3683 return number; | 3786 return number; |
3684 number = nextNumber; | 3787 number = nextNumber; |
3685 } | 3788 } |
3686 } | 3789 } |
3687 _checkModification(expectedModificationCount) { | 3790 [_checkModification](expectedModificationCount) { |
3688 if (expectedModificationCount !== this._modificationCount) { | 3791 if (expectedModificationCount !== this[_modificationCount]) { |
3689 throw new core.ConcurrentModificationError(this); | 3792 throw new core.ConcurrentModificationError(this); |
3690 } | 3793 } |
3691 } | 3794 } |
3692 _add(element) { | 3795 [_add](element) { |
3693 this._table.set(this._tail, element); | 3796 this[_table].set(this[_tail], element); |
3694 this._tail = this._tail + 1 & this._table.length - 1; | 3797 this[_tail] = this[_tail] + 1 & this[_table].length - 1; |
3695 if (this._head === this._tail) | 3798 if (this[_head] === this[_tail]) |
3696 this._grow(); | 3799 this[_grow](); |
3697 this._modificationCount++; | 3800 this[_modificationCount]++; |
3698 } | 3801 } |
3699 _remove(offset) { | 3802 [_remove](offset) { |
3700 let mask = this._table.length - 1; | 3803 let mask = this[_table].length - 1; |
3701 let startDistance = offset - this._head & mask; | 3804 let startDistance = offset - this[_head] & mask; |
3702 let endDistance = this._tail - offset & mask; | 3805 let endDistance = this[_tail] - offset & mask; |
3703 if (startDistance < endDistance) { | 3806 if (startDistance < endDistance) { |
3704 let i = offset; | 3807 let i = offset; |
3705 while (i !== this._head) { | 3808 while (i !== this[_head]) { |
3706 let prevOffset = i - 1 & mask; | 3809 let prevOffset = i - 1 & mask; |
3707 this._table.set(i, this._table.get(prevOffset)); | 3810 this[_table].set(i, this[_table].get(prevOffset)); |
3708 i = prevOffset; | 3811 i = prevOffset; |
3709 } | 3812 } |
3710 this._table.set(this._head, dart.as(null, E)); | 3813 this[_table].set(this[_head], dart.as(null, E)); |
3711 this._head = this._head + 1 & mask; | 3814 this[_head] = this[_head] + 1 & mask; |
3712 return offset + 1 & mask; | 3815 return offset + 1 & mask; |
3713 } else { | 3816 } else { |
3714 this._tail = this._tail - 1 & mask; | 3817 this[_tail] = this[_tail] - 1 & mask; |
3715 let i = offset; | 3818 let i = offset; |
3716 while (i !== this._tail) { | 3819 while (i !== this[_tail]) { |
3717 let nextOffset = i + 1 & mask; | 3820 let nextOffset = i + 1 & mask; |
3718 this._table.set(i, this._table.get(nextOffset)); | 3821 this[_table].set(i, this[_table].get(nextOffset)); |
3719 i = nextOffset; | 3822 i = nextOffset; |
3720 } | 3823 } |
3721 this._table.set(this._tail, dart.as(null, E)); | 3824 this[_table].set(this[_tail], dart.as(null, E)); |
3722 return offset; | 3825 return offset; |
3723 } | 3826 } |
3724 } | 3827 } |
3725 _grow() { | 3828 [_grow]() { |
3726 let newTable = new core.List(this._table.length * 2); | 3829 let newTable = new core.List(this[_table].length * 2); |
3727 let split = this._table.length - this._head; | 3830 let split = this[_table].length - this[_head]; |
3728 newTable.setRange(0, split, this._table, this._head); | 3831 newTable.setRange(0, split, this[_table], this[_head]); |
3729 newTable.setRange(split, split + this._head, this._table, 0); | 3832 newTable.setRange(split, split + this[_head], this[_table], 0); |
3730 this._head = 0; | 3833 this[_head] = 0; |
3731 this._tail = this._table.length; | 3834 this[_tail] = this[_table].length; |
3732 this._table = newTable; | 3835 this[_table] = newTable; |
3733 } | 3836 } |
3734 _writeToList(target) { | 3837 [_writeToList](target) { |
3735 dart.assert(target.length >= this.length); | 3838 dart.assert(target.length >= this.length); |
3736 if (this._head <= this._tail) { | 3839 if (this[_head] <= this[_tail]) { |
3737 let length = this._tail - this._head; | 3840 let length = this[_tail] - this[_head]; |
3738 target.setRange(0, length, this._table, this._head); | 3841 target.setRange(0, length, this[_table], this[_head]); |
3739 return length; | 3842 return length; |
3740 } else { | 3843 } else { |
3741 let firstPartSize = this._table.length - this._head; | 3844 let firstPartSize = this[_table].length - this[_head]; |
3742 target.setRange(0, firstPartSize, this._table, this._head); | 3845 target.setRange(0, firstPartSize, this[_table], this[_head]); |
3743 target.setRange(firstPartSize, firstPartSize + this._tail, this._table
, 0); | 3846 target.setRange(firstPartSize, firstPartSize + this[_tail], this[_tabl
e], 0); |
3744 return this._tail + firstPartSize; | 3847 return this[_tail] + firstPartSize; |
3745 } | 3848 } |
3746 } | 3849 } |
3747 _preGrow(newElementCount) { | 3850 [_preGrow](newElementCount) { |
3748 dart.assert(newElementCount >= this.length); | 3851 dart.assert(newElementCount >= this.length); |
3749 newElementCount = newElementCount >> 1; | 3852 newElementCount = newElementCount >> 1; |
3750 let newCapacity = _nextPowerOf2(newElementCount); | 3853 let newCapacity = _nextPowerOf2(newElementCount); |
3751 let newTable = new core.List(newCapacity); | 3854 let newTable = new core.List(newCapacity); |
3752 this._tail = this._writeToList(newTable); | 3855 this[_tail] = this[_writeToList](newTable); |
3753 this._table = newTable; | 3856 this[_table] = newTable; |
3754 this._head = 0; | 3857 this[_head] = 0; |
3755 } | 3858 } |
3756 } | 3859 } |
3757 dart.defineNamedConstructor(ListQueue, 'from'); | 3860 dart.defineNamedConstructor(ListQueue, 'from'); |
3758 ListQueue._INITIAL_CAPACITY = 8; | 3861 ListQueue._INITIAL_CAPACITY = 8; |
3759 return ListQueue; | 3862 return ListQueue; |
3760 }); | 3863 }); |
3761 let ListQueue = ListQueue$(dynamic); | 3864 let ListQueue = ListQueue$(dynamic); |
3762 let _ListQueueIterator$ = dart.generic(function(E) { | 3865 let _ListQueueIterator$ = dart.generic(function(E) { |
3763 class _ListQueueIterator extends dart.Object { | 3866 class _ListQueueIterator extends dart.Object { |
3764 _ListQueueIterator(queue) { | 3867 _ListQueueIterator(queue) { |
3765 this._queue = queue; | 3868 this[_queue] = queue; |
3766 this._end = queue._tail; | 3869 this[_end] = queue[_tail]; |
3767 this._modificationCount = queue._modificationCount; | 3870 this[_modificationCount] = queue[_modificationCount]; |
3768 this._position = queue._head; | 3871 this[_position] = queue[_head]; |
3769 this._current = dart.as(null, E); | 3872 this[_current] = dart.as(null, E); |
3770 } | 3873 } |
3771 get current() { | 3874 get current() { |
3772 return this._current; | 3875 return this[_current]; |
3773 } | 3876 } |
3774 moveNext() { | 3877 moveNext() { |
3775 this._queue._checkModification(this._modificationCount); | 3878 this[_queue]._checkModification(this[_modificationCount]); |
3776 if (this._position === this._end) { | 3879 if (this[_position] === this[_end]) { |
3777 this._current = dart.as(null, E); | 3880 this[_current] = dart.as(null, E); |
3778 return false; | 3881 return false; |
3779 } | 3882 } |
3780 this._current = dart.as(this._queue._table.get(this._position), E); | 3883 this[_current] = dart.as(this[_queue][_table].get(this[_position]), E); |
3781 this._position = this._position + 1 & this._queue._table.length - 1; | 3884 this[_position] = this[_position] + 1 & this[_queue][_table].length - 1; |
3782 return true; | 3885 return true; |
3783 } | 3886 } |
3784 } | 3887 } |
3785 return _ListQueueIterator; | 3888 return _ListQueueIterator; |
3786 }); | 3889 }); |
3787 let _ListQueueIterator = _ListQueueIterator$(dynamic); | 3890 let _ListQueueIterator = _ListQueueIterator$(dynamic); |
3788 let SetMixin$ = dart.generic(function(E) { | 3891 let SetMixin$ = dart.generic(function(E) { |
3789 class SetMixin extends dart.Object { | 3892 class SetMixin extends dart.Object { |
3790 get isEmpty() { | 3893 get isEmpty() { |
3791 return this.length === 0; | 3894 return this.length === 0; |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4057 this.value = value; | 4160 this.value = value; |
4058 super._SplayTreeNode(key); | 4161 super._SplayTreeNode(key); |
4059 } | 4162 } |
4060 } | 4163 } |
4061 return _SplayTreeMapNode; | 4164 return _SplayTreeMapNode; |
4062 }); | 4165 }); |
4063 let _SplayTreeMapNode = _SplayTreeMapNode$(dynamic, dynamic); | 4166 let _SplayTreeMapNode = _SplayTreeMapNode$(dynamic, dynamic); |
4064 let _SplayTree$ = dart.generic(function(K) { | 4167 let _SplayTree$ = dart.generic(function(K) { |
4065 class _SplayTree extends dart.Object { | 4168 class _SplayTree extends dart.Object { |
4066 _SplayTree() { | 4169 _SplayTree() { |
4067 this._dummy = new _SplayTreeNode(dart.as(null, K)); | 4170 this[_dummy] = new _SplayTreeNode(dart.as(null, K)); |
4068 this._root = null; | 4171 this[_root] = null; |
4069 this._count = 0; | 4172 this[_count] = 0; |
4070 this._modificationCount = 0; | 4173 this[_modificationCount] = 0; |
4071 this._splayCount = 0; | 4174 this[_splayCount] = 0; |
4072 } | 4175 } |
4073 _splay(key) { | 4176 [_splay](key) { |
4074 if (this._root === null) | 4177 if (this[_root] === null) |
4075 return -1; | 4178 return -1; |
4076 let left = this._dummy; | 4179 let left = this[_dummy]; |
4077 let right = this._dummy; | 4180 let right = this[_dummy]; |
4078 let current = this._root; | 4181 let current = this[_root]; |
4079 let comp = null; | 4182 let comp = null; |
4080 while (true) { | 4183 while (true) { |
4081 comp = this._compare(current.key, key); | 4184 comp = this[_compare](current.key, key); |
4082 if (comp > 0) { | 4185 if (comp > 0) { |
4083 if (current.left === null) | 4186 if (current.left === null) |
4084 break; | 4187 break; |
4085 comp = this._compare(current.left.key, key); | 4188 comp = this[_compare](current.left.key, key); |
4086 if (comp > 0) { | 4189 if (comp > 0) { |
4087 let tmp = current.left; | 4190 let tmp = current.left; |
4088 current.left = tmp.right; | 4191 current.left = tmp.right; |
4089 tmp.right = current; | 4192 tmp.right = current; |
4090 current = tmp; | 4193 current = tmp; |
4091 if (current.left === null) | 4194 if (current.left === null) |
4092 break; | 4195 break; |
4093 } | 4196 } |
4094 right.left = current; | 4197 right.left = current; |
4095 right = current; | 4198 right = current; |
4096 current = current.left; | 4199 current = current.left; |
4097 } else if (comp < 0) { | 4200 } else if (comp < 0) { |
4098 if (current.right === null) | 4201 if (current.right === null) |
4099 break; | 4202 break; |
4100 comp = this._compare(current.right.key, key); | 4203 comp = this[_compare](current.right.key, key); |
4101 if (comp < 0) { | 4204 if (comp < 0) { |
4102 let tmp = current.right; | 4205 let tmp = current.right; |
4103 current.right = tmp.left; | 4206 current.right = tmp.left; |
4104 tmp.left = current; | 4207 tmp.left = current; |
4105 current = tmp; | 4208 current = tmp; |
4106 if (current.right === null) | 4209 if (current.right === null) |
4107 break; | 4210 break; |
4108 } | 4211 } |
4109 left.right = current; | 4212 left.right = current; |
4110 left = current; | 4213 left = current; |
4111 current = current.right; | 4214 current = current.right; |
4112 } else { | 4215 } else { |
4113 break; | 4216 break; |
4114 } | 4217 } |
4115 } | 4218 } |
4116 left.right = current.left; | 4219 left.right = current.left; |
4117 right.left = current.right; | 4220 right.left = current.right; |
4118 current.left = this._dummy.right; | 4221 current.left = this[_dummy].right; |
4119 current.right = this._dummy.left; | 4222 current.right = this[_dummy].left; |
4120 this._root = current; | 4223 this[_root] = current; |
4121 this._dummy.right = null; | 4224 this[_dummy].right = null; |
4122 this._dummy.left = null; | 4225 this[_dummy].left = null; |
4123 this._splayCount++; | 4226 this[_splayCount]++; |
4124 return comp; | 4227 return comp; |
4125 } | 4228 } |
4126 _splayMin(node) { | 4229 [_splayMin](node) { |
4127 let current = node; | 4230 let current = node; |
4128 while (current.left !== null) { | 4231 while (current.left !== null) { |
4129 let left = current.left; | 4232 let left = current.left; |
4130 current.left = left.right; | 4233 current.left = left.right; |
4131 left.right = current; | 4234 left.right = current; |
4132 current = left; | 4235 current = left; |
4133 } | 4236 } |
4134 return dart.as(current, _SplayTreeNode$(K)); | 4237 return dart.as(current, _SplayTreeNode$(K)); |
4135 } | 4238 } |
4136 _splayMax(node) { | 4239 [_splayMax](node) { |
4137 let current = node; | 4240 let current = node; |
4138 while (current.right !== null) { | 4241 while (current.right !== null) { |
4139 let right = current.right; | 4242 let right = current.right; |
4140 current.right = right.left; | 4243 current.right = right.left; |
4141 right.left = current; | 4244 right.left = current; |
4142 current = right; | 4245 current = right; |
4143 } | 4246 } |
4144 return dart.as(current, _SplayTreeNode$(K)); | 4247 return dart.as(current, _SplayTreeNode$(K)); |
4145 } | 4248 } |
4146 _remove(key) { | 4249 [_remove](key) { |
4147 if (this._root === null) | 4250 if (this[_root] === null) |
4148 return null; | 4251 return null; |
4149 let comp = this._splay(key); | 4252 let comp = this[_splay](key); |
4150 if (comp !== 0) | 4253 if (comp !== 0) |
4151 return null; | 4254 return null; |
4152 let result = this._root; | 4255 let result = this[_root]; |
4153 this._count--; | 4256 this[_count]--; |
4154 if (this._root.left === null) { | 4257 if (this[_root].left === null) { |
4155 this._root = this._root.right; | 4258 this[_root] = this[_root].right; |
4156 } else { | 4259 } else { |
4157 let right = this._root.right; | 4260 let right = this[_root].right; |
4158 this._root = this._splayMax(this._root.left); | 4261 this[_root] = this[_splayMax](this[_root].left); |
4159 this._root.right = right; | 4262 this[_root].right = right; |
4160 } | 4263 } |
4161 this._modificationCount++; | 4264 this[_modificationCount]++; |
4162 return result; | 4265 return result; |
4163 } | 4266 } |
4164 _addNewRoot(node, comp) { | 4267 [_addNewRoot](node, comp) { |
4165 this._count++; | 4268 this[_count]++; |
4166 this._modificationCount++; | 4269 this[_modificationCount]++; |
4167 if (this._root === null) { | 4270 if (this[_root] === null) { |
4168 this._root = node; | 4271 this[_root] = node; |
4169 return; | 4272 return; |
4170 } | 4273 } |
4171 if (comp < 0) { | 4274 if (comp < 0) { |
4172 node.left = this._root; | 4275 node.left = this[_root]; |
4173 node.right = this._root.right; | 4276 node.right = this[_root].right; |
4174 this._root.right = null; | 4277 this[_root].right = null; |
4175 } else { | 4278 } else { |
4176 node.right = this._root; | 4279 node.right = this[_root]; |
4177 node.left = this._root.left; | 4280 node.left = this[_root].left; |
4178 this._root.left = null; | 4281 this[_root].left = null; |
4179 } | 4282 } |
4180 this._root = node; | 4283 this[_root] = node; |
4181 } | 4284 } |
4182 get _first() { | 4285 get [_first]() { |
4183 if (this._root === null) | 4286 if (this[_root] === null) |
4184 return null; | 4287 return null; |
4185 this._root = this._splayMin(this._root); | 4288 this[_root] = this[_splayMin](this[_root]); |
4186 return this._root; | 4289 return this[_root]; |
4187 } | 4290 } |
4188 get _last() { | 4291 get [_last]() { |
4189 if (this._root === null) | 4292 if (this[_root] === null) |
4190 return null; | 4293 return null; |
4191 this._root = this._splayMax(this._root); | 4294 this[_root] = this[_splayMax](this[_root]); |
4192 return this._root; | 4295 return this[_root]; |
4193 } | 4296 } |
4194 _clear() { | 4297 [_clear]() { |
4195 this._root = null; | 4298 this[_root] = null; |
4196 this._count = 0; | 4299 this[_count] = 0; |
4197 this._modificationCount++; | 4300 this[_modificationCount]++; |
4198 } | 4301 } |
4199 } | 4302 } |
4200 return _SplayTree; | 4303 return _SplayTree; |
4201 }); | 4304 }); |
4202 let _SplayTree = _SplayTree$(dynamic); | 4305 let _SplayTree = _SplayTree$(dynamic); |
4203 let _TypeTest$ = dart.generic(function(T) { | 4306 let _TypeTest$ = dart.generic(function(T) { |
4204 class _TypeTest extends dart.Object { | 4307 class _TypeTest extends dart.Object { |
4205 test(v) { | 4308 test(v) { |
4206 return dart.is(v, T); | 4309 return dart.is(v, T); |
4207 } | 4310 } |
4208 } | 4311 } |
4209 return _TypeTest; | 4312 return _TypeTest; |
4210 }); | 4313 }); |
4211 let _TypeTest = _TypeTest$(dynamic); | 4314 let _TypeTest = _TypeTest$(dynamic); |
4212 let SplayTreeMap$ = dart.generic(function(K, V) { | 4315 let SplayTreeMap$ = dart.generic(function(K, V) { |
4213 class SplayTreeMap extends _SplayTree$(K) { | 4316 class SplayTreeMap extends _SplayTree$(K) { |
4214 SplayTreeMap(compare, isValidKey) { | 4317 SplayTreeMap(compare, isValidKey) { |
4215 if (compare === void 0) | 4318 if (compare === void 0) |
4216 compare = null; | 4319 compare = null; |
4217 if (isValidKey === void 0) | 4320 if (isValidKey === void 0) |
4218 isValidKey = null; | 4321 isValidKey = null; |
4219 this._comparator = dart.as(compare === null ? core.Comparable.compare :
compare, core.Comparator); | 4322 this[_comparator] = dart.as(compare === null ? core.Comparable.compare :
compare, core.Comparator); |
4220 this._validKey = dart.as(isValidKey !== null ? isValidKey : (v) => dart.
is(v, K), _Predicate); | 4323 this[_validKey] = dart.as(isValidKey !== null ? isValidKey : (v) => dart
.is(v, K), _Predicate); |
4221 super._SplayTree(); | 4324 super._SplayTree(); |
4222 } | 4325 } |
4223 SplayTreeMap$from(other, compare, isValidKey) { | 4326 SplayTreeMap$from(other, compare, isValidKey) { |
4224 if (compare === void 0) | 4327 if (compare === void 0) |
4225 compare = null; | 4328 compare = null; |
4226 if (isValidKey === void 0) | 4329 if (isValidKey === void 0) |
4227 isValidKey = null; | 4330 isValidKey = null; |
4228 let result = new SplayTreeMap(); | 4331 let result = new SplayTreeMap(); |
4229 other.forEach((k, v) => { | 4332 other.forEach((k, v) => { |
4230 result.set(k, dart.as(v, V)); | 4333 result.set(k, dart.as(v, V)); |
(...skipping 11 matching lines...) Expand all Loading... |
4242 } | 4345 } |
4243 SplayTreeMap$fromIterables(keys, values, compare, isValidKey) { | 4346 SplayTreeMap$fromIterables(keys, values, compare, isValidKey) { |
4244 if (compare === void 0) | 4347 if (compare === void 0) |
4245 compare = null; | 4348 compare = null; |
4246 if (isValidKey === void 0) | 4349 if (isValidKey === void 0) |
4247 isValidKey = null; | 4350 isValidKey = null; |
4248 let map = new SplayTreeMap(compare, isValidKey); | 4351 let map = new SplayTreeMap(compare, isValidKey); |
4249 Maps._fillMapWithIterables(map, keys, values); | 4352 Maps._fillMapWithIterables(map, keys, values); |
4250 return map; | 4353 return map; |
4251 } | 4354 } |
4252 _compare(key1, key2) { | 4355 [_compare](key1, key2) { |
4253 return this._comparator(key1, key2); | 4356 return this[_comparator](key1, key2); |
4254 } | 4357 } |
4255 SplayTreeMap$_internal() { | 4358 SplayTreeMap$_internal() { |
4256 this._comparator = null; | 4359 this[_comparator] = null; |
4257 this._validKey = null; | 4360 this[_validKey] = null; |
4258 super._SplayTree(); | 4361 super._SplayTree(); |
4259 } | 4362 } |
4260 get(key) { | 4363 get(key) { |
4261 if (key === null) | 4364 if (key === null) |
4262 throw new core.ArgumentError(key); | 4365 throw new core.ArgumentError(key); |
4263 if (!dart.notNull(this._validKey(key))) | 4366 if (!dart.notNull(this[_validKey](key))) |
4264 return dart.as(null, V); | 4367 return dart.as(null, V); |
4265 if (this._root !== null) { | 4368 if (this[_root] !== null) { |
4266 let comp = this._splay(dart.as(key, K)); | 4369 let comp = this[_splay](dart.as(key, K)); |
4267 if (comp === 0) { | 4370 if (comp === 0) { |
4268 let mapRoot = dart.as(this._root, _SplayTreeMapNode); | 4371 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); |
4269 return dart.as(mapRoot.value, V); | 4372 return dart.as(mapRoot.value, V); |
4270 } | 4373 } |
4271 } | 4374 } |
4272 return dart.as(null, V); | 4375 return dart.as(null, V); |
4273 } | 4376 } |
4274 remove(key) { | 4377 remove(key) { |
4275 if (!dart.notNull(this._validKey(key))) | 4378 if (!dart.notNull(this[_validKey](key))) |
4276 return dart.as(null, V); | 4379 return dart.as(null, V); |
4277 let mapRoot = dart.as(this._remove(dart.as(key, K)), _SplayTreeMapNode); | 4380 let mapRoot = dart.as(this[_remove](dart.as(key, K)), _SplayTreeMapNode)
; |
4278 if (mapRoot !== null) | 4381 if (mapRoot !== null) |
4279 return dart.as(mapRoot.value, V); | 4382 return dart.as(mapRoot.value, V); |
4280 return dart.as(null, V); | 4383 return dart.as(null, V); |
4281 } | 4384 } |
4282 set(key, value) { | 4385 set(key, value) { |
4283 if (key === null) | 4386 if (key === null) |
4284 throw new core.ArgumentError(key); | 4387 throw new core.ArgumentError(key); |
4285 let comp = this._splay(key); | 4388 let comp = this[_splay](key); |
4286 if (comp === 0) { | 4389 if (comp === 0) { |
4287 let mapRoot = dart.as(this._root, _SplayTreeMapNode); | 4390 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); |
4288 mapRoot.value = value; | 4391 mapRoot.value = value; |
4289 return; | 4392 return; |
4290 } | 4393 } |
4291 this._addNewRoot(dart.as(new _SplayTreeMapNode(key, value), _SplayTreeNo
de$(K)), comp); | 4394 this[_addNewRoot](dart.as(new _SplayTreeMapNode(key, value), _SplayTreeN
ode$(K)), comp); |
4292 } | 4395 } |
4293 putIfAbsent(key, ifAbsent) { | 4396 putIfAbsent(key, ifAbsent) { |
4294 if (key === null) | 4397 if (key === null) |
4295 throw new core.ArgumentError(key); | 4398 throw new core.ArgumentError(key); |
4296 let comp = this._splay(key); | 4399 let comp = this[_splay](key); |
4297 if (comp === 0) { | 4400 if (comp === 0) { |
4298 let mapRoot = dart.as(this._root, _SplayTreeMapNode); | 4401 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); |
4299 return dart.as(mapRoot.value, V); | 4402 return dart.as(mapRoot.value, V); |
4300 } | 4403 } |
4301 let modificationCount = this._modificationCount; | 4404 let modificationCount = this[_modificationCount]; |
4302 let splayCount = this._splayCount; | 4405 let splayCount = this[_splayCount]; |
4303 let value = ifAbsent(); | 4406 let value = ifAbsent(); |
4304 if (modificationCount !== this._modificationCount) { | 4407 if (modificationCount !== this[_modificationCount]) { |
4305 throw new core.ConcurrentModificationError(this); | 4408 throw new core.ConcurrentModificationError(this); |
4306 } | 4409 } |
4307 if (splayCount !== this._splayCount) { | 4410 if (splayCount !== this[_splayCount]) { |
4308 comp = this._splay(key); | 4411 comp = this[_splay](key); |
4309 dart.assert(comp !== 0); | 4412 dart.assert(comp !== 0); |
4310 } | 4413 } |
4311 this._addNewRoot(dart.as(new _SplayTreeMapNode(key, value), _SplayTreeNo
de$(K)), comp); | 4414 this[_addNewRoot](dart.as(new _SplayTreeMapNode(key, value), _SplayTreeN
ode$(K)), comp); |
4312 return value; | 4415 return value; |
4313 } | 4416 } |
4314 addAll(other) { | 4417 addAll(other) { |
4315 other.forEach(((key, value) => { | 4418 other.forEach(((key, value) => { |
4316 this.set(key, value); | 4419 this.set(key, value); |
4317 }).bind(this)); | 4420 }).bind(this)); |
4318 } | 4421 } |
4319 get isEmpty() { | 4422 get isEmpty() { |
4320 return this._root === null; | 4423 return this[_root] === null; |
4321 } | 4424 } |
4322 get isNotEmpty() { | 4425 get isNotEmpty() { |
4323 return !dart.notNull(this.isEmpty); | 4426 return !dart.notNull(this.isEmpty); |
4324 } | 4427 } |
4325 forEach(f) { | 4428 forEach(f) { |
4326 let nodes = new _SplayTreeNodeIterator(this); | 4429 let nodes = new _SplayTreeNodeIterator(this); |
4327 while (nodes.moveNext()) { | 4430 while (nodes.moveNext()) { |
4328 let node = dart.as(nodes.current, _SplayTreeMapNode$(K, V)); | 4431 let node = dart.as(nodes.current, _SplayTreeMapNode$(K, V)); |
4329 f(node.key, node.value); | 4432 f(node.key, node.value); |
4330 } | 4433 } |
4331 } | 4434 } |
4332 get length() { | 4435 get length() { |
4333 return this._count; | 4436 return this[_count]; |
4334 } | 4437 } |
4335 clear() { | 4438 clear() { |
4336 this._clear(); | 4439 this[_clear](); |
4337 } | 4440 } |
4338 containsKey(key) { | 4441 containsKey(key) { |
4339 return dart.notNull(this._validKey(key)) && dart.notNull(this._splay(dar
t.as(key, K)) === 0); | 4442 return dart.notNull(this[_validKey](key)) && dart.notNull(this[_splay](d
art.as(key, K)) === 0); |
4340 } | 4443 } |
4341 containsValue(value) { | 4444 containsValue(value) { |
4342 let found = false; | 4445 let found = false; |
4343 let initialSplayCount = this._splayCount; | 4446 let initialSplayCount = this[_splayCount]; |
4344 // Function visit: (_SplayTreeMapNode<dynamic, dynamic>) → bool | 4447 // Function visit: (_SplayTreeMapNode<dynamic, dynamic>) → bool |
4345 function visit(node) { | 4448 function visit(node) { |
4346 while (node !== null) { | 4449 while (node !== null) { |
4347 if (dart.equals(node.value, value)) | 4450 if (dart.equals(node.value, value)) |
4348 return true; | 4451 return true; |
4349 if (initialSplayCount !== this._splayCount) { | 4452 if (initialSplayCount !== this[_splayCount]) { |
4350 throw new core.ConcurrentModificationError(this); | 4453 throw new core.ConcurrentModificationError(this); |
4351 } | 4454 } |
4352 if (dart.notNull(node.right !== null) && dart.notNull(visit(dart.as(
node.right, _SplayTreeMapNode)))) | 4455 if (dart.notNull(node.right !== null) && dart.notNull(visit(dart.as(
node.right, _SplayTreeMapNode)))) |
4353 return true; | 4456 return true; |
4354 node = dart.as(node.left, _SplayTreeMapNode); | 4457 node = dart.as(node.left, _SplayTreeMapNode); |
4355 } | 4458 } |
4356 return false; | 4459 return false; |
4357 } | 4460 } |
4358 return visit(dart.as(this._root, _SplayTreeMapNode)); | 4461 return visit(dart.as(this[_root], _SplayTreeMapNode)); |
4359 } | 4462 } |
4360 get keys() { | 4463 get keys() { |
4361 return new _SplayTreeKeyIterable(this); | 4464 return new _SplayTreeKeyIterable(this); |
4362 } | 4465 } |
4363 get values() { | 4466 get values() { |
4364 return new _SplayTreeValueIterable(this); | 4467 return new _SplayTreeValueIterable(this); |
4365 } | 4468 } |
4366 toString() { | 4469 toString() { |
4367 return Maps.mapToString(this); | 4470 return Maps.mapToString(this); |
4368 } | 4471 } |
4369 firstKey() { | 4472 firstKey() { |
4370 if (this._root === null) | 4473 if (this[_root] === null) |
4371 return dart.as(null, K); | 4474 return dart.as(null, K); |
4372 return dart.as(this._first.key, K); | 4475 return dart.as(this[_first].key, K); |
4373 } | 4476 } |
4374 lastKey() { | 4477 lastKey() { |
4375 if (this._root === null) | 4478 if (this[_root] === null) |
4376 return dart.as(null, K); | 4479 return dart.as(null, K); |
4377 return dart.as(this._last.key, K); | 4480 return dart.as(this[_last].key, K); |
4378 } | 4481 } |
4379 lastKeyBefore(key) { | 4482 lastKeyBefore(key) { |
4380 if (key === null) | 4483 if (key === null) |
4381 throw new core.ArgumentError(key); | 4484 throw new core.ArgumentError(key); |
4382 if (this._root === null) | 4485 if (this[_root] === null) |
4383 return dart.as(null, K); | 4486 return dart.as(null, K); |
4384 let comp = this._splay(key); | 4487 let comp = this[_splay](key); |
4385 if (comp < 0) | 4488 if (comp < 0) |
4386 return this._root.key; | 4489 return this[_root].key; |
4387 let node = this._root.left; | 4490 let node = this[_root].left; |
4388 if (node === null) | 4491 if (node === null) |
4389 return dart.as(null, K); | 4492 return dart.as(null, K); |
4390 while (node.right !== null) { | 4493 while (node.right !== null) { |
4391 node = node.right; | 4494 node = node.right; |
4392 } | 4495 } |
4393 return node.key; | 4496 return node.key; |
4394 } | 4497 } |
4395 firstKeyAfter(key) { | 4498 firstKeyAfter(key) { |
4396 if (key === null) | 4499 if (key === null) |
4397 throw new core.ArgumentError(key); | 4500 throw new core.ArgumentError(key); |
4398 if (this._root === null) | 4501 if (this[_root] === null) |
4399 return dart.as(null, K); | 4502 return dart.as(null, K); |
4400 let comp = this._splay(key); | 4503 let comp = this[_splay](key); |
4401 if (comp > 0) | 4504 if (comp > 0) |
4402 return this._root.key; | 4505 return this[_root].key; |
4403 let node = this._root.right; | 4506 let node = this[_root].right; |
4404 if (node === null) | 4507 if (node === null) |
4405 return dart.as(null, K); | 4508 return dart.as(null, K); |
4406 while (node.left !== null) { | 4509 while (node.left !== null) { |
4407 node = node.left; | 4510 node = node.left; |
4408 } | 4511 } |
4409 return node.key; | 4512 return node.key; |
4410 } | 4513 } |
4411 } | 4514 } |
4412 dart.defineNamedConstructor(SplayTreeMap, 'from'); | 4515 dart.defineNamedConstructor(SplayTreeMap, 'from'); |
4413 dart.defineNamedConstructor(SplayTreeMap, 'fromIterable'); | 4516 dart.defineNamedConstructor(SplayTreeMap, 'fromIterable'); |
4414 dart.defineNamedConstructor(SplayTreeMap, 'fromIterables'); | 4517 dart.defineNamedConstructor(SplayTreeMap, 'fromIterables'); |
4415 dart.defineNamedConstructor(SplayTreeMap, '_internal'); | 4518 dart.defineNamedConstructor(SplayTreeMap, '_internal'); |
4416 return SplayTreeMap; | 4519 return SplayTreeMap; |
4417 }); | 4520 }); |
4418 let SplayTreeMap = SplayTreeMap$(dynamic, dynamic); | 4521 let SplayTreeMap = SplayTreeMap$(dynamic, dynamic); |
4419 let _SplayTreeIterator$ = dart.generic(function(T) { | 4522 let _SplayTreeIterator$ = dart.generic(function(T) { |
4420 class _SplayTreeIterator extends dart.Object { | 4523 class _SplayTreeIterator extends dart.Object { |
4421 _SplayTreeIterator(tree) { | 4524 _SplayTreeIterator(tree) { |
4422 this._workList = new List.from([]); | 4525 this[_workList] = new List.from([]); |
4423 this._tree = tree; | 4526 this[_tree] = tree; |
4424 this._modificationCount = tree._modificationCount; | 4527 this[_modificationCount] = tree[_modificationCount]; |
4425 this._splayCount = tree._splayCount; | 4528 this[_splayCount] = tree[_splayCount]; |
4426 this._currentNode = null; | 4529 this[_currentNode] = null; |
4427 this._findLeftMostDescendent(tree._root); | 4530 this[_findLeftMostDescendent](tree[_root]); |
4428 } | 4531 } |
4429 _SplayTreeIterator$startAt(tree, startKey) { | 4532 _SplayTreeIterator$startAt(tree, startKey) { |
4430 this._workList = new List.from([]); | 4533 this[_workList] = new List.from([]); |
4431 this._tree = tree; | 4534 this[_tree] = tree; |
4432 this._modificationCount = tree._modificationCount; | 4535 this[_modificationCount] = tree[_modificationCount]; |
4433 this._splayCount = dart.as(null, core.int); | 4536 this[_splayCount] = dart.as(null, core.int); |
4434 this._currentNode = null; | 4537 this[_currentNode] = null; |
4435 if (tree._root === null) | 4538 if (tree[_root] === null) |
4436 return; | 4539 return; |
4437 let compare = tree._splay(startKey); | 4540 let compare = tree._splay(startKey); |
4438 this._splayCount = tree._splayCount; | 4541 this[_splayCount] = tree[_splayCount]; |
4439 if (compare < 0) { | 4542 if (compare < 0) { |
4440 this._findLeftMostDescendent(tree._root.right); | 4543 this[_findLeftMostDescendent](tree[_root].right); |
4441 } else { | 4544 } else { |
4442 this._workList.add(tree._root); | 4545 this[_workList].add(tree[_root]); |
4443 } | 4546 } |
4444 } | 4547 } |
4445 get current() { | 4548 get current() { |
4446 if (this._currentNode === null) | 4549 if (this[_currentNode] === null) |
4447 return dart.as(null, T); | 4550 return dart.as(null, T); |
4448 return this._getValue(this._currentNode); | 4551 return this[_getValue](this[_currentNode]); |
4449 } | 4552 } |
4450 _findLeftMostDescendent(node) { | 4553 [_findLeftMostDescendent](node) { |
4451 while (node !== null) { | 4554 while (node !== null) { |
4452 this._workList.add(node); | 4555 this[_workList].add(node); |
4453 node = node.left; | 4556 node = node.left; |
4454 } | 4557 } |
4455 } | 4558 } |
4456 _rebuildWorkList(currentNode) { | 4559 [_rebuildWorkList](currentNode) { |
4457 dart.assert(!dart.notNull(this._workList.isEmpty)); | 4560 dart.assert(!dart.notNull(this[_workList].isEmpty)); |
4458 this._workList.clear(); | 4561 this[_workList].clear(); |
4459 if (currentNode === null) { | 4562 if (currentNode === null) { |
4460 this._findLeftMostDescendent(this._tree._root); | 4563 this[_findLeftMostDescendent](this[_tree][_root]); |
4461 } else { | 4564 } else { |
4462 this._tree._splay(currentNode.key); | 4565 this[_tree]._splay(currentNode.key); |
4463 this._findLeftMostDescendent(this._tree._root.right); | 4566 this[_findLeftMostDescendent](this[_tree][_root].right); |
4464 dart.assert(!dart.notNull(this._workList.isEmpty)); | 4567 dart.assert(!dart.notNull(this[_workList].isEmpty)); |
4465 } | 4568 } |
4466 } | 4569 } |
4467 moveNext() { | 4570 moveNext() { |
4468 if (this._modificationCount !== this._tree._modificationCount) { | 4571 if (this[_modificationCount] !== this[_tree][_modificationCount]) { |
4469 throw new core.ConcurrentModificationError(this._tree); | 4572 throw new core.ConcurrentModificationError(this[_tree]); |
4470 } | 4573 } |
4471 if (this._workList.isEmpty) { | 4574 if (this[_workList].isEmpty) { |
4472 this._currentNode = null; | 4575 this[_currentNode] = null; |
4473 return false; | 4576 return false; |
4474 } | 4577 } |
4475 if (dart.notNull(this._tree._splayCount !== this._splayCount) && dart.no
tNull(this._currentNode !== null)) { | 4578 if (dart.notNull(this[_tree][_splayCount] !== this[_splayCount]) && dart
.notNull(this[_currentNode] !== null)) { |
4476 this._rebuildWorkList(this._currentNode); | 4579 this[_rebuildWorkList](this[_currentNode]); |
4477 } | 4580 } |
4478 this._currentNode = this._workList.removeLast(); | 4581 this[_currentNode] = this[_workList].removeLast(); |
4479 this._findLeftMostDescendent(this._currentNode.right); | 4582 this[_findLeftMostDescendent](this[_currentNode].right); |
4480 return true; | 4583 return true; |
4481 } | 4584 } |
4482 } | 4585 } |
4483 dart.defineNamedConstructor(_SplayTreeIterator, 'startAt'); | 4586 dart.defineNamedConstructor(_SplayTreeIterator, 'startAt'); |
4484 return _SplayTreeIterator; | 4587 return _SplayTreeIterator; |
4485 }); | 4588 }); |
4486 let _SplayTreeIterator = _SplayTreeIterator$(dynamic); | 4589 let _SplayTreeIterator = _SplayTreeIterator$(dynamic); |
4487 let _SplayTreeKeyIterable$ = dart.generic(function(K) { | 4590 let _SplayTreeKeyIterable$ = dart.generic(function(K) { |
4488 class _SplayTreeKeyIterable extends IterableBase$(K) { | 4591 class _SplayTreeKeyIterable extends IterableBase$(K) { |
4489 _SplayTreeKeyIterable(_tree) { | 4592 _SplayTreeKeyIterable($_tree) { |
4490 this._tree = _tree; | 4593 this[_tree] = $_tree; |
4491 super.IterableBase(); | 4594 super.IterableBase(); |
4492 } | 4595 } |
4493 get length() { | 4596 get length() { |
4494 return this._tree._count; | 4597 return this[_tree][_count]; |
4495 } | 4598 } |
4496 get isEmpty() { | 4599 get isEmpty() { |
4497 return this._tree._count === 0; | 4600 return this[_tree][_count] === 0; |
4498 } | 4601 } |
4499 get iterator() { | 4602 get iterator() { |
4500 return new _SplayTreeKeyIterator(this._tree); | 4603 return new _SplayTreeKeyIterator(this[_tree]); |
4501 } | 4604 } |
4502 toSet() { | 4605 toSet() { |
4503 let setOrMap = this._tree; | 4606 let setOrMap = this[_tree]; |
4504 let set = new SplayTreeSet(dart.as(setOrMap._comparator, dart.throw_("Un
implemented type (K, K) → int")), dart.as(setOrMap._validKey, dart.throw_("Unimp
lemented type (dynamic) → bool"))); | 4607 let set = new SplayTreeSet(dart.as(setOrMap[_comparator], dart.throw_("U
nimplemented type (K, K) → int")), dart.as(setOrMap[_validKey], dart.throw_("Uni
mplemented type (dynamic) → bool"))); |
4505 set._count = this._tree._count; | 4608 set[_count] = this[_tree][_count]; |
4506 set._root = set._copyNode(this._tree._root); | 4609 set[_root] = set._copyNode(this[_tree][_root]); |
4507 return set; | 4610 return set; |
4508 } | 4611 } |
4509 } | 4612 } |
4510 return _SplayTreeKeyIterable; | 4613 return _SplayTreeKeyIterable; |
4511 }); | 4614 }); |
4512 let _SplayTreeKeyIterable = _SplayTreeKeyIterable$(dynamic); | 4615 let _SplayTreeKeyIterable = _SplayTreeKeyIterable$(dynamic); |
4513 let _SplayTreeValueIterable$ = dart.generic(function(K, V) { | 4616 let _SplayTreeValueIterable$ = dart.generic(function(K, V) { |
4514 class _SplayTreeValueIterable extends IterableBase$(V) { | 4617 class _SplayTreeValueIterable extends IterableBase$(V) { |
4515 _SplayTreeValueIterable(_map) { | 4618 _SplayTreeValueIterable($_map) { |
4516 this._map = _map; | 4619 this[_map] = $_map; |
4517 super.IterableBase(); | 4620 super.IterableBase(); |
4518 } | 4621 } |
4519 get length() { | 4622 get length() { |
4520 return this._map._count; | 4623 return this[_map][_count]; |
4521 } | 4624 } |
4522 get isEmpty() { | 4625 get isEmpty() { |
4523 return this._map._count === 0; | 4626 return this[_map][_count] === 0; |
4524 } | 4627 } |
4525 get iterator() { | 4628 get iterator() { |
4526 return new _SplayTreeValueIterator(this._map); | 4629 return new _SplayTreeValueIterator(this[_map]); |
4527 } | 4630 } |
4528 } | 4631 } |
4529 return _SplayTreeValueIterable; | 4632 return _SplayTreeValueIterable; |
4530 }); | 4633 }); |
4531 let _SplayTreeValueIterable = _SplayTreeValueIterable$(dynamic, dynamic); | 4634 let _SplayTreeValueIterable = _SplayTreeValueIterable$(dynamic, dynamic); |
4532 let _SplayTreeKeyIterator$ = dart.generic(function(K) { | 4635 let _SplayTreeKeyIterator$ = dart.generic(function(K) { |
4533 class _SplayTreeKeyIterator extends _SplayTreeIterator$(K) { | 4636 class _SplayTreeKeyIterator extends _SplayTreeIterator$(K) { |
4534 _SplayTreeKeyIterator(map) { | 4637 _SplayTreeKeyIterator(map) { |
4535 super._SplayTreeIterator(map); | 4638 super._SplayTreeIterator(map); |
4536 } | 4639 } |
4537 _getValue(node) { | 4640 [_getValue](node) { |
4538 return dart.as(node.key, K); | 4641 return dart.as(node.key, K); |
4539 } | 4642 } |
4540 } | 4643 } |
4541 return _SplayTreeKeyIterator; | 4644 return _SplayTreeKeyIterator; |
4542 }); | 4645 }); |
4543 let _SplayTreeKeyIterator = _SplayTreeKeyIterator$(dynamic); | 4646 let _SplayTreeKeyIterator = _SplayTreeKeyIterator$(dynamic); |
4544 let _SplayTreeValueIterator$ = dart.generic(function(K, V) { | 4647 let _SplayTreeValueIterator$ = dart.generic(function(K, V) { |
4545 class _SplayTreeValueIterator extends _SplayTreeIterator$(V) { | 4648 class _SplayTreeValueIterator extends _SplayTreeIterator$(V) { |
4546 _SplayTreeValueIterator(map) { | 4649 _SplayTreeValueIterator(map) { |
4547 super._SplayTreeIterator(map); | 4650 super._SplayTreeIterator(map); |
4548 } | 4651 } |
4549 _getValue(node) { | 4652 [_getValue](node) { |
4550 return dart.as(node.value, V); | 4653 return dart.as(node.value, V); |
4551 } | 4654 } |
4552 } | 4655 } |
4553 return _SplayTreeValueIterator; | 4656 return _SplayTreeValueIterator; |
4554 }); | 4657 }); |
4555 let _SplayTreeValueIterator = _SplayTreeValueIterator$(dynamic, dynamic); | 4658 let _SplayTreeValueIterator = _SplayTreeValueIterator$(dynamic, dynamic); |
4556 let _SplayTreeNodeIterator$ = dart.generic(function(K) { | 4659 let _SplayTreeNodeIterator$ = dart.generic(function(K) { |
4557 class _SplayTreeNodeIterator extends _SplayTreeIterator$(_SplayTreeNode$(K))
{ | 4660 class _SplayTreeNodeIterator extends _SplayTreeIterator$(_SplayTreeNode$(K))
{ |
4558 _SplayTreeNodeIterator(tree) { | 4661 _SplayTreeNodeIterator(tree) { |
4559 super._SplayTreeIterator(tree); | 4662 super._SplayTreeIterator(tree); |
4560 } | 4663 } |
4561 _SplayTreeNodeIterator$startAt(tree, startKey) { | 4664 _SplayTreeNodeIterator$startAt(tree, startKey) { |
4562 super._SplayTreeIterator$startAt(tree, startKey); | 4665 super._SplayTreeIterator$startAt(tree, startKey); |
4563 } | 4666 } |
4564 _getValue(node) { | 4667 [_getValue](node) { |
4565 return dart.as(node, _SplayTreeNode$(K)); | 4668 return dart.as(node, _SplayTreeNode$(K)); |
4566 } | 4669 } |
4567 } | 4670 } |
4568 dart.defineNamedConstructor(_SplayTreeNodeIterator, 'startAt'); | 4671 dart.defineNamedConstructor(_SplayTreeNodeIterator, 'startAt'); |
4569 return _SplayTreeNodeIterator; | 4672 return _SplayTreeNodeIterator; |
4570 }); | 4673 }); |
4571 let _SplayTreeNodeIterator = _SplayTreeNodeIterator$(dynamic); | 4674 let _SplayTreeNodeIterator = _SplayTreeNodeIterator$(dynamic); |
4572 let SplayTreeSet$ = dart.generic(function(E) { | 4675 let SplayTreeSet$ = dart.generic(function(E) { |
4573 class SplayTreeSet extends dart.mixin(_SplayTree$(E), IterableMixin$(E), Set
Mixin$(E)) { | 4676 class SplayTreeSet extends dart.mixin(_SplayTree$(E), IterableMixin$(E), Set
Mixin$(E)) { |
4574 SplayTreeSet(compare, isValidKey) { | 4677 SplayTreeSet(compare, isValidKey) { |
4575 if (compare === void 0) | 4678 if (compare === void 0) |
4576 compare = null; | 4679 compare = null; |
4577 if (isValidKey === void 0) | 4680 if (isValidKey === void 0) |
4578 isValidKey = null; | 4681 isValidKey = null; |
4579 this._comparator = dart.as(compare === null ? core.Comparable.compare :
compare, core.Comparator); | 4682 this[_comparator] = dart.as(compare === null ? core.Comparable.compare :
compare, core.Comparator); |
4580 this._validKey = dart.as(isValidKey !== null ? isValidKey : (v) => dart.
is(v, E), _Predicate); | 4683 this[_validKey] = dart.as(isValidKey !== null ? isValidKey : (v) => dart
.is(v, E), _Predicate); |
4581 super._SplayTree(); | 4684 super._SplayTree(); |
4582 } | 4685 } |
4583 SplayTreeSet$from(elements, compare, isValidKey) { | 4686 SplayTreeSet$from(elements, compare, isValidKey) { |
4584 if (compare === void 0) | 4687 if (compare === void 0) |
4585 compare = null; | 4688 compare = null; |
4586 if (isValidKey === void 0) | 4689 if (isValidKey === void 0) |
4587 isValidKey = null; | 4690 isValidKey = null; |
4588 let result = new SplayTreeSet(compare, isValidKey); | 4691 let result = new SplayTreeSet(compare, isValidKey); |
4589 for (let element of elements) { | 4692 for (let element of elements) { |
4590 result.add(element); | 4693 result.add(element); |
4591 } | 4694 } |
4592 return result; | 4695 return result; |
4593 } | 4696 } |
4594 _compare(e1, e2) { | 4697 [_compare](e1, e2) { |
4595 return this._comparator(e1, e2); | 4698 return this[_comparator](e1, e2); |
4596 } | 4699 } |
4597 get iterator() { | 4700 get iterator() { |
4598 return new _SplayTreeKeyIterator(this); | 4701 return new _SplayTreeKeyIterator(this); |
4599 } | 4702 } |
4600 get length() { | 4703 get length() { |
4601 return this._count; | 4704 return this[_count]; |
4602 } | 4705 } |
4603 get isEmpty() { | 4706 get isEmpty() { |
4604 return this._root === null; | 4707 return this[_root] === null; |
4605 } | 4708 } |
4606 get isNotEmpty() { | 4709 get isNotEmpty() { |
4607 return this._root !== null; | 4710 return this[_root] !== null; |
4608 } | 4711 } |
4609 get first() { | 4712 get first() { |
4610 if (this._count === 0) | 4713 if (this[_count] === 0) |
4611 throw _internal.IterableElementError.noElement(); | 4714 throw _internal.IterableElementError.noElement(); |
4612 return dart.as(this._first.key, E); | 4715 return dart.as(this[_first].key, E); |
4613 } | 4716 } |
4614 get last() { | 4717 get last() { |
4615 if (this._count === 0) | 4718 if (this[_count] === 0) |
4616 throw _internal.IterableElementError.noElement(); | 4719 throw _internal.IterableElementError.noElement(); |
4617 return dart.as(this._last.key, E); | 4720 return dart.as(this[_last].key, E); |
4618 } | 4721 } |
4619 get single() { | 4722 get single() { |
4620 if (this._count === 0) | 4723 if (this[_count] === 0) |
4621 throw _internal.IterableElementError.noElement(); | 4724 throw _internal.IterableElementError.noElement(); |
4622 if (this._count > 1) | 4725 if (this[_count] > 1) |
4623 throw _internal.IterableElementError.tooMany(); | 4726 throw _internal.IterableElementError.tooMany(); |
4624 return this._root.key; | 4727 return this[_root].key; |
4625 } | 4728 } |
4626 contains(object) { | 4729 contains(object) { |
4627 return dart.notNull(this._validKey(object)) && dart.notNull(this._splay(
dart.as(object, E)) === 0); | 4730 return dart.notNull(this[_validKey](object)) && dart.notNull(this[_splay
](dart.as(object, E)) === 0); |
4628 } | 4731 } |
4629 add(element) { | 4732 add(element) { |
4630 let compare = this._splay(element); | 4733 let compare = this[_splay](element); |
4631 if (compare === 0) | 4734 if (compare === 0) |
4632 return false; | 4735 return false; |
4633 this._addNewRoot(dart.as(new _SplayTreeNode(element), _SplayTreeNode$(E)
), compare); | 4736 this[_addNewRoot](dart.as(new _SplayTreeNode(element), _SplayTreeNode$(E
)), compare); |
4634 return true; | 4737 return true; |
4635 } | 4738 } |
4636 remove(object) { | 4739 remove(object) { |
4637 if (!dart.notNull(this._validKey(object))) | 4740 if (!dart.notNull(this[_validKey](object))) |
4638 return false; | 4741 return false; |
4639 return this._remove(dart.as(object, E)) !== null; | 4742 return this[_remove](dart.as(object, E)) !== null; |
4640 } | 4743 } |
4641 addAll(elements) { | 4744 addAll(elements) { |
4642 for (let element of elements) { | 4745 for (let element of elements) { |
4643 let compare = this._splay(element); | 4746 let compare = this[_splay](element); |
4644 if (compare !== 0) { | 4747 if (compare !== 0) { |
4645 this._addNewRoot(dart.as(new _SplayTreeNode(element), _SplayTreeNode
$(E)), compare); | 4748 this[_addNewRoot](dart.as(new _SplayTreeNode(element), _SplayTreeNod
e$(E)), compare); |
4646 } | 4749 } |
4647 } | 4750 } |
4648 } | 4751 } |
4649 removeAll(elements) { | 4752 removeAll(elements) { |
4650 for (let element of elements) { | 4753 for (let element of elements) { |
4651 if (this._validKey(element)) | 4754 if (this[_validKey](element)) |
4652 this._remove(dart.as(element, E)); | 4755 this[_remove](dart.as(element, E)); |
4653 } | 4756 } |
4654 } | 4757 } |
4655 retainAll(elements) { | 4758 retainAll(elements) { |
4656 let retainSet = new SplayTreeSet(this._comparator, this._validKey); | 4759 let retainSet = new SplayTreeSet(this[_comparator], this[_validKey]); |
4657 let modificationCount = this._modificationCount; | 4760 let modificationCount = this[_modificationCount]; |
4658 for (let object of elements) { | 4761 for (let object of elements) { |
4659 if (modificationCount !== this._modificationCount) { | 4762 if (modificationCount !== this[_modificationCount]) { |
4660 throw new core.ConcurrentModificationError(this); | 4763 throw new core.ConcurrentModificationError(this); |
4661 } | 4764 } |
4662 if (dart.notNull(this._validKey(object)) && dart.notNull(this._splay(d
art.as(object, E)) === 0)) | 4765 if (dart.notNull(this[_validKey](object)) && dart.notNull(this[_splay]
(dart.as(object, E)) === 0)) |
4663 retainSet.add(this._root.key); | 4766 retainSet.add(this[_root].key); |
4664 } | 4767 } |
4665 if (retainSet._count !== this._count) { | 4768 if (retainSet[_count] !== this[_count]) { |
4666 this._root = retainSet._root; | 4769 this[_root] = retainSet[_root]; |
4667 this._count = retainSet._count; | 4770 this[_count] = retainSet[_count]; |
4668 this._modificationCount++; | 4771 this[_modificationCount]++; |
4669 } | 4772 } |
4670 } | 4773 } |
4671 lookup(object) { | 4774 lookup(object) { |
4672 if (!dart.notNull(this._validKey(object))) | 4775 if (!dart.notNull(this[_validKey](object))) |
4673 return dart.as(null, E); | 4776 return dart.as(null, E); |
4674 let comp = this._splay(dart.as(object, E)); | 4777 let comp = this[_splay](dart.as(object, E)); |
4675 if (comp !== 0) | 4778 if (comp !== 0) |
4676 return dart.as(null, E); | 4779 return dart.as(null, E); |
4677 return this._root.key; | 4780 return this[_root].key; |
4678 } | 4781 } |
4679 intersection(other) { | 4782 intersection(other) { |
4680 let result = new SplayTreeSet(this._comparator, this._validKey); | 4783 let result = new SplayTreeSet(this[_comparator], this[_validKey]); |
4681 for (let element of this) { | 4784 for (let element of this) { |
4682 if (other.contains(element)) | 4785 if (other.contains(element)) |
4683 result.add(element); | 4786 result.add(element); |
4684 } | 4787 } |
4685 return result; | 4788 return result; |
4686 } | 4789 } |
4687 difference(other) { | 4790 difference(other) { |
4688 let result = new SplayTreeSet(this._comparator, this._validKey); | 4791 let result = new SplayTreeSet(this[_comparator], this[_validKey]); |
4689 for (let element of this) { | 4792 for (let element of this) { |
4690 if (!dart.notNull(other.contains(element))) | 4793 if (!dart.notNull(other.contains(element))) |
4691 result.add(element); | 4794 result.add(element); |
4692 } | 4795 } |
4693 return result; | 4796 return result; |
4694 } | 4797 } |
4695 union(other) { | 4798 union(other) { |
4696 return ((_) => { | 4799 return ((_) => { |
4697 _.addAll(other); | 4800 _.addAll(other); |
4698 return _; | 4801 return _; |
4699 }).bind(this)(this._clone()); | 4802 }).bind(this)(this[_clone]()); |
4700 } | 4803 } |
4701 _clone() { | 4804 [_clone]() { |
4702 let set = new SplayTreeSet(this._comparator, this._validKey); | 4805 let set = new SplayTreeSet(this[_comparator], this[_validKey]); |
4703 set._count = this._count; | 4806 set[_count] = this[_count]; |
4704 set._root = this._copyNode(this._root); | 4807 set[_root] = this[_copyNode](this[_root]); |
4705 return set; | 4808 return set; |
4706 } | 4809 } |
4707 _copyNode(node) { | 4810 [_copyNode](node) { |
4708 if (node === null) | 4811 if (node === null) |
4709 return null; | 4812 return null; |
4710 return ((_) => { | 4813 return ((_) => { |
4711 _.left = this._copyNode(node.left); | 4814 _.left = this[_copyNode](node.left); |
4712 _.right = this._copyNode(node.right); | 4815 _.right = this[_copyNode](node.right); |
4713 return _; | 4816 return _; |
4714 }).bind(this)(new _SplayTreeNode(node.key)); | 4817 }).bind(this)(new _SplayTreeNode(node.key)); |
4715 } | 4818 } |
4716 clear() { | 4819 clear() { |
4717 this._clear(); | 4820 this[_clear](); |
4718 } | 4821 } |
4719 toSet() { | 4822 toSet() { |
4720 return this._clone(); | 4823 return this[_clone](); |
4721 } | 4824 } |
4722 toString() { | 4825 toString() { |
4723 return IterableBase.iterableToFullString(this, '{', '}'); | 4826 return IterableBase.iterableToFullString(this, '{', '}'); |
4724 } | 4827 } |
4725 } | 4828 } |
4726 dart.defineNamedConstructor(SplayTreeSet, 'from'); | 4829 dart.defineNamedConstructor(SplayTreeSet, 'from'); |
4727 return SplayTreeSet; | 4830 return SplayTreeSet; |
4728 }); | 4831 }); |
4729 let SplayTreeSet = SplayTreeSet$(dynamic); | 4832 let SplayTreeSet = SplayTreeSet$(dynamic); |
4730 // Exports: | 4833 // Exports: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4787 collection.ListQueue$ = ListQueue$; | 4890 collection.ListQueue$ = ListQueue$; |
4788 collection.SetMixin = SetMixin; | 4891 collection.SetMixin = SetMixin; |
4789 collection.SetMixin$ = SetMixin$; | 4892 collection.SetMixin$ = SetMixin$; |
4790 collection.SetBase = SetBase; | 4893 collection.SetBase = SetBase; |
4791 collection.SetBase$ = SetBase$; | 4894 collection.SetBase$ = SetBase$; |
4792 collection.SplayTreeMap = SplayTreeMap; | 4895 collection.SplayTreeMap = SplayTreeMap; |
4793 collection.SplayTreeMap$ = SplayTreeMap$; | 4896 collection.SplayTreeMap$ = SplayTreeMap$; |
4794 collection.SplayTreeSet = SplayTreeSet; | 4897 collection.SplayTreeSet = SplayTreeSet; |
4795 collection.SplayTreeSet$ = SplayTreeSet$; | 4898 collection.SplayTreeSet$ = SplayTreeSet$; |
4796 })(collection || (collection = {})); | 4899 })(collection || (collection = {})); |
OLD | NEW |