OLD | NEW |
1 part of dart.collection; | 1 part of dart.collection; |
2 typedef bool _Predicate<T>(T value); | 2 typedef bool _Predicate<T>(T value); |
3 class _SplayTreeNode<K> {final K key; | 3 class _SplayTreeNode<K> {final K key; |
4 _SplayTreeNode<K> left; | 4 _SplayTreeNode<K> left; |
5 _SplayTreeNode<K> right; | 5 _SplayTreeNode<K> right; |
6 _SplayTreeNode(K this.key); | 6 _SplayTreeNode(K this.key); |
7 } | 7 } |
8 class _SplayTreeMapNode<K, V> extends _SplayTreeNode<K> {V value; | 8 class _SplayTreeMapNode<K, V> extends _SplayTreeNode<K> {V value; |
9 _SplayTreeMapNode(K key, V this.value) : super(key); | 9 _SplayTreeMapNode(K key, V this.value) : super(key); |
10 } | 10 } |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 } | 387 } |
388 T _getValue(_SplayTreeNode node); | 388 T _getValue(_SplayTreeNode node); |
389 } | 389 } |
390 class _SplayTreeKeyIterable<K> extends IterableBase<K> implements EfficientLeng
th {_SplayTree<K> _tree; | 390 class _SplayTreeKeyIterable<K> extends IterableBase<K> implements EfficientLeng
th {_SplayTree<K> _tree; |
391 _SplayTreeKeyIterable(this._tree); | 391 _SplayTreeKeyIterable(this._tree); |
392 int get length => _tree._count; | 392 int get length => _tree._count; |
393 bool get isEmpty => _tree._count == 0; | 393 bool get isEmpty => _tree._count == 0; |
394 Iterator<K> get iterator => new _SplayTreeKeyIterator<K>(_tree); | 394 Iterator<K> get iterator => new _SplayTreeKeyIterator<K>(_tree); |
395 Set<K> toSet() { | 395 Set<K> toSet() { |
396 var setOrMap = _tree; | 396 var setOrMap = _tree; |
397 SplayTreeSet<K> set = new SplayTreeSet<K>(DEVC$RT.cast(setOrMap._comparator, dy
namic, DEVC$RT.type((__t15<K> _) { | 397 SplayTreeSet<K> set = new SplayTreeSet<K>(DEVC$RT.cast(setOrMap._comparator, dy
namic, DEVC$RT.type((__CastType15<K> _) { |
398 } | 398 } |
399 ), "CompositeCast", """line 613, column 29 of dart:collection/splay_tree.dart: "
"", setOrMap._comparator is __t15<K>, false), DEVC$RT.cast(setOrMap._validKey, d
ynamic, __t18, "CompositeCast", """line 613, column 51 of dart:collection/splay_
tree.dart: """, setOrMap._validKey is __t18, false)); | 399 ), "CompositeCast", """line 613, column 29 of dart:collection/splay_tree.dart: "
"", setOrMap._comparator is __CastType15<K>, false), DEVC$RT.cast(setOrMap._vali
dKey, dynamic, __CastType18, "CompositeCast", """line 613, column 51 of dart:col
lection/splay_tree.dart: """, setOrMap._validKey is __CastType18, false)); |
400 set._count = _tree._count; | 400 set._count = _tree._count; |
401 set._root = set._copyNode(_tree._root); | 401 set._root = set._copyNode(_tree._root); |
402 return set; | 402 return set; |
403 } | 403 } |
404 } | 404 } |
405 class _SplayTreeValueIterable<K, V> extends IterableBase<V> implements Efficien
tLength {SplayTreeMap<K, V> _map; | 405 class _SplayTreeValueIterable<K, V> extends IterableBase<V> implements Efficien
tLength {SplayTreeMap<K, V> _map; |
406 _SplayTreeValueIterable(this._map); | 406 _SplayTreeValueIterable(this._map); |
407 int get length => _map._count; | 407 int get length => _map._count; |
408 bool get isEmpty => _map._count == 0; | 408 bool get isEmpty => _map._count == 0; |
409 Iterator<V> get iterator => new _SplayTreeValueIterator<K, V>(_map); | 409 Iterator<V> get iterator => new _SplayTreeValueIterator<K, V>(_map); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 } | 480 } |
481 } | 481 } |
482 void removeAll(Iterable<Object> elements) { | 482 void removeAll(Iterable<Object> elements) { |
483 for (Object element in elements) { | 483 for (Object element in elements) { |
484 if (_validKey(element)) _remove(DEVC$RT.cast(element, Object, E, "CompositeCast"
, """line 767, column 39 of dart:collection/splay_tree.dart: """, element is E,
false)); | 484 if (_validKey(element)) _remove(DEVC$RT.cast(element, Object, E, "CompositeCast"
, """line 767, column 39 of dart:collection/splay_tree.dart: """, element is E,
false)); |
485 } | 485 } |
486 } | 486 } |
487 void retainAll(Iterable<Object> elements) { | 487 void retainAll(Iterable<Object> elements) { |
488 SplayTreeSet<E> retainSet = new SplayTreeSet<E>(DEVC$RT.cast(_comparator, DEVC$R
T.type((Comparator<dynamic> _) { | 488 SplayTreeSet<E> retainSet = new SplayTreeSet<E>(DEVC$RT.cast(_comparator, DEVC$R
T.type((Comparator<dynamic> _) { |
489 } | 489 } |
490 ), DEVC$RT.type((__t22<E> _) { | 490 ), DEVC$RT.type((__CastType22<E> _) { |
491 } | 491 } |
492 ), "CompositeCast", """line 773, column 53 of dart:collection/splay_tree.dart: "
"", _comparator is __t22<E>, false), _validKey); | 492 ), "CompositeCast", """line 773, column 53 of dart:collection/splay_tree.dart: "
"", _comparator is __CastType22<E>, false), _validKey); |
493 int modificationCount = _modificationCount; | 493 int modificationCount = _modificationCount; |
494 for (Object object in elements) { | 494 for (Object object in elements) { |
495 if (modificationCount != _modificationCount) { | 495 if (modificationCount != _modificationCount) { |
496 throw new ConcurrentModificationError(this); | 496 throw new ConcurrentModificationError(this); |
497 } | 497 } |
498 if (_validKey(object) && _splay(DEVC$RT.cast(object, Object, E, "CompositeCast"
, """line 781, column 39 of dart:collection/splay_tree.dart: """, object is E, f
alse)) == 0) retainSet.add(_root.key); | 498 if (_validKey(object) && _splay(DEVC$RT.cast(object, Object, E, "CompositeCast"
, """line 781, column 39 of dart:collection/splay_tree.dart: """, object is E, f
alse)) == 0) retainSet.add(_root.key); |
499 } | 499 } |
500 if (retainSet._count != _count) { | 500 if (retainSet._count != _count) { |
501 _root = retainSet._root; | 501 _root = retainSet._root; |
502 _count = retainSet._count; | 502 _count = retainSet._count; |
503 _modificationCount++; | 503 _modificationCount++; |
504 } | 504 } |
505 } | 505 } |
506 E lookup(Object object) { | 506 E lookup(Object object) { |
507 if (!_validKey(object)) return null; | 507 if (!_validKey(object)) return null; |
508 int comp = _splay(DEVC$RT.cast(object, Object, E, "CompositeCast", """line 793,
column 23 of dart:collection/splay_tree.dart: """, object is E, false)); | 508 int comp = _splay(DEVC$RT.cast(object, Object, E, "CompositeCast", """line 793,
column 23 of dart:collection/splay_tree.dart: """, object is E, false)); |
509 if (comp != 0) return null; | 509 if (comp != 0) return null; |
510 return _root.key; | 510 return _root.key; |
511 } | 511 } |
512 Set<E> intersection(Set<E> other) { | 512 Set<E> intersection(Set<E> other) { |
513 Set<E> result = new SplayTreeSet<E>(DEVC$RT.cast(_comparator, DEVC$RT.type((Comp
arator<dynamic> _) { | 513 Set<E> result = new SplayTreeSet<E>(DEVC$RT.cast(_comparator, DEVC$RT.type((Comp
arator<dynamic> _) { |
514 } | 514 } |
515 ), DEVC$RT.type((__t22<E> _) { | 515 ), DEVC$RT.type((__CastType22<E> _) { |
516 } | 516 } |
517 ), "CompositeCast", """line 799, column 41 of dart:collection/splay_tree.dart: "
"", _comparator is __t22<E>, false), _validKey); | 517 ), "CompositeCast", """line 799, column 41 of dart:collection/splay_tree.dart: "
"", _comparator is __CastType22<E>, false), _validKey); |
518 for (E element in this) { | 518 for (E element in this) { |
519 if (other.contains(element)) result.add(element); | 519 if (other.contains(element)) result.add(element); |
520 } | 520 } |
521 return result; | 521 return result; |
522 } | 522 } |
523 Set<E> difference(Set<E> other) { | 523 Set<E> difference(Set<E> other) { |
524 Set<E> result = new SplayTreeSet<E>(DEVC$RT.cast(_comparator, DEVC$RT.type((Comp
arator<dynamic> _) { | 524 Set<E> result = new SplayTreeSet<E>(DEVC$RT.cast(_comparator, DEVC$RT.type((Comp
arator<dynamic> _) { |
525 } | 525 } |
526 ), DEVC$RT.type((__t22<E> _) { | 526 ), DEVC$RT.type((__CastType22<E> _) { |
527 } | 527 } |
528 ), "CompositeCast", """line 807, column 41 of dart:collection/splay_tree.dart: "
"", _comparator is __t22<E>, false), _validKey); | 528 ), "CompositeCast", """line 807, column 41 of dart:collection/splay_tree.dart: "
"", _comparator is __CastType22<E>, false), _validKey); |
529 for (E element in this) { | 529 for (E element in this) { |
530 if (!other.contains(element)) result.add(element); | 530 if (!other.contains(element)) result.add(element); |
531 } | 531 } |
532 return result; | 532 return result; |
533 } | 533 } |
534 Set<E> union(Set<E> other) { | 534 Set<E> union(Set<E> other) { |
535 return _clone()..addAll(other); | 535 return _clone()..addAll(other); |
536 } | 536 } |
537 SplayTreeSet<E> _clone() { | 537 SplayTreeSet<E> _clone() { |
538 var set = new SplayTreeSet<E>(DEVC$RT.cast(_comparator, DEVC$RT.type((Comparator
<dynamic> _) { | 538 var set = new SplayTreeSet<E>(DEVC$RT.cast(_comparator, DEVC$RT.type((Comparator
<dynamic> _) { |
539 } | 539 } |
540 ), DEVC$RT.type((__t22<E> _) { | 540 ), DEVC$RT.type((__CastType22<E> _) { |
541 } | 541 } |
542 ), "CompositeCast", """line 819, column 35 of dart:collection/splay_tree.dart: "
"", _comparator is __t22<E>, false), _validKey); | 542 ), "CompositeCast", """line 819, column 35 of dart:collection/splay_tree.dart: "
"", _comparator is __CastType22<E>, false), _validKey); |
543 set._count = _count; | 543 set._count = _count; |
544 set._root = _copyNode(_root); | 544 set._root = _copyNode(_root); |
545 return set; | 545 return set; |
546 } | 546 } |
547 _SplayTreeNode<E> _copyNode(_SplayTreeNode<E> node) { | 547 _SplayTreeNode<E> _copyNode(_SplayTreeNode<E> node) { |
548 if (node == null) return null; | 548 if (node == null) return null; |
549 return new _SplayTreeNode<E>(node.key)..left = _copyNode(node.left)..right = _c
opyNode(node.right); | 549 return new _SplayTreeNode<E>(node.key)..left = _copyNode(node.left)..right = _c
opyNode(node.right); |
550 } | 550 } |
551 void clear() { | 551 void clear() { |
552 _clear(); | 552 _clear(); |
553 } | 553 } |
554 Set<E> toSet() => _clone(); | 554 Set<E> toSet() => _clone(); |
555 String toString() => IterableBase.iterableToFullString(this, '{', '}'); | 555 String toString() => IterableBase.iterableToFullString(this, '{', '}'); |
556 } | 556 } |
557 typedef int __t15<K>(K __u16, K __u17); | 557 typedef int __CastType15<K>(K __u16, K __u17); |
558 typedef bool __t18(dynamic __u19); | 558 typedef bool __CastType18(dynamic __u19); |
559 typedef int __t22<E>(E __u23, E __u24); | 559 typedef int __CastType22<E>(E __u23, E __u24); |
OLD | NEW |