Exemplo n.º 1
0
 private RootwardNode()
 {
     this.Parent         = this;
     this.SiblingOfChild = LeafwardNode.Nil;
     this.Data           = null;
     this.IsRed          = false;
 }
Exemplo n.º 2
0
 public ZipperNode(KeyVal content, bool isRed, LeafwardNode left, LeafwardNode right, RootwardNode parent, Func <TAggregate, TKey, TVal, TAggregate, TAggregate> aggregator)
 {
     this.Data       = content;
     this.IsRed      = isRed;
     this.Left       = left;
     this.Right      = right;
     this.Parent     = parent;
     this.Aggregator = aggregator;
 }
Exemplo n.º 3
0
 public ZipperNode(Func <TAggregate, TKey, TVal, TAggregate, TAggregate> aggregator)
 {
     this.Left       = LeafwardNode.Nil;
     this.Right      = LeafwardNode.Nil;
     this.Parent     = RootwardNode.Nil;
     this.Data       = null;
     this.IsRed      = false;
     this.Aggregator = aggregator;
 }
Exemplo n.º 4
0
 public RootwardNode(KeyVal data, bool isRed, RootwardNode parent, LeafwardNode siblingOfChild, bool isLeft)
 {
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     if (parent == null)
     {
         throw new ArgumentNullException("parent");
     }
     if (siblingOfChild == null)
     {
         throw new ArgumentNullException("siblingOfChild");
     }
     this.Data           = data;
     this.Parent         = parent;
     this.SiblingOfChild = siblingOfChild;
     this.IsChildOnLeft  = isLeft;
     this.IsRed          = isRed;
 }
Exemplo n.º 5
0
 public ZipperNode ColoredLike(RootwardNode other)
 {
     return(new ZipperNode(this.Data, other.IsRed, this.Left, this.Right, this.Parent, Aggregator));
 }
Exemplo n.º 6
0
 public ZipperNode WithParent(RootwardNode newParent)
 {
     return(new ZipperNode(Data, IsRed, Left, Right, newParent, Aggregator));
 }
Exemplo n.º 7
0
 public static ZipperNode From(RootwardNode parent, KeyVal content, bool isRed, LeafwardNode c1, LeafwardNode c2, bool c1IsLeft, Func <TAggregate, TKey, TVal, TAggregate, TAggregate> aggregator)
 {
     return(new ZipperNode(content, isRed, c1IsLeft ? c1 : c2, c1IsLeft ? c2 : c1, parent, aggregator));
 }