| 507 | } |
| 508 | |
| 509 | static abstract class Node extends AMapEntry{ |
| 510 | final Object key; |
| 511 | |
| 512 | Node(Object key){ |
| 513 | this.key = key; |
| 514 | } |
| 515 | |
| 516 | public Object key(){ |
| 517 | return key; |
| 518 | } |
| 519 | |
| 520 | public Object val(){ |
| 521 | return null; |
| 522 | } |
| 523 | |
| 524 | public Object getKey(){ |
| 525 | return key(); |
| 526 | } |
| 527 | |
| 528 | public Object getValue(){ |
| 529 | return val(); |
| 530 | } |
| 531 | |
| 532 | Node left(){ |
| 533 | return null; |
| 534 | } |
| 535 | |
| 536 | Node right(){ |
| 537 | return null; |
| 538 | } |
| 539 | |
| 540 | abstract Node addLeft(Node ins); |
| 541 | |
| 542 | abstract Node addRight(Node ins); |
| 543 | |
| 544 | abstract Node removeLeft(Node del); |
| 545 | |
| 546 | abstract Node removeRight(Node del); |
| 547 | |
| 548 | abstract Node blacken(); |
| 549 | |
| 550 | abstract Node redden(); |
| 551 | |
| 552 | Node balanceLeft(Node parent){ |
| 553 | return black(parent.key, parent.val(), this, parent.right()); |
| 554 | } |
| 555 | |
| 556 | Node balanceRight(Node parent){ |
| 557 | return black(parent.key, parent.val(), parent.left(), this); |
| 558 | } |
| 559 | |
| 560 | abstract Node replace(Object key, Object val, Node left, Node right); |
| 561 | |
| 562 | public Object kvreduce(IFn f, Object init){ |
| 563 | if(left() != null){ |
| 564 | init = left().kvreduce(f, init); |
| 565 | if(RT.isReduced(init)) |
| 566 | return init; |
nothing calls this directly
no outgoing calls
no test coverage detected