Пример #1
0
 private bool Traverse(Tree startingNode, ICancellableVisitor4 visitor)
 {
     if (startingNode != null)
     {
         int cmp = Compare(startingNode);
         if (cmp < 0)
         {
             if (_subsequent != null)
             {
                 return(_subsequent.Traverse(startingNode, visitor));
             }
             return(true);
         }
         else
         {
             if (cmp > 0)
             {
                 if (_preceding != null)
                 {
                     if (!_preceding.Traverse(startingNode, visitor))
                     {
                         return(false);
                     }
                 }
             }
         }
     }
     else
     {
         if (_preceding != null)
         {
             if (!_preceding.Traverse(null, visitor))
             {
                 return(false);
             }
         }
     }
     if (!visitor.Visit(this))
     {
         return(false);
     }
     if (_subsequent != null)
     {
         if (!_subsequent.Traverse(null, visitor))
         {
             return(false);
         }
     }
     return(true);
 }
Пример #2
0
 public static void Traverse(Tree tree, IVisitor4 visitor)
 {
     if (tree == null)
     {
         return;
     }
     tree.Traverse(visitor);
 }
Пример #3
0
 /// <summary>Traverses a tree with a starting point node.</summary>
 /// <remarks>
 /// Traverses a tree with a starting point node.
 /// If there is no exact match for the starting node, the next higher will be taken.
 /// </remarks>
 public static void Traverse(Tree tree, Tree startingNode, ICancellableVisitor4 visitor
                             )
 {
     if (tree == null)
     {
         return;
     }
     tree.Traverse(startingNode, visitor);
 }
Пример #4
0
		/// <summary>Traverses a tree with a starting point node.</summary>
		/// <remarks>
		/// Traverses a tree with a starting point node.
		/// If there is no exact match for the starting node, the next higher will be taken.
		/// </remarks>
		public static void Traverse(Tree tree, Tree startingNode, ICancellableVisitor4 visitor
			)
		{
			if (tree == null)
			{
				return;
			}
			tree.Traverse(startingNode, visitor);
		}
Пример #5
0
		public static void Traverse(Tree tree, IVisitor4 visitor)
		{
			if (tree == null)
			{
				return;
			}
			tree.Traverse(visitor);
		}
Пример #6
0
		private void Read(ByteArrayBuffer reader)
		{
			FreeSlotNode.sizeLimit = DiscardLimit();
			_freeBySize = new TreeReader(reader, new FreeSlotNode(0), true).Read();
			ByRef addressTree = ByRef.NewInstance();
			if (_freeBySize != null)
			{
				_freeBySize.Traverse(new _IVisitor4_176(addressTree));
			}
			_freeByAddress = ((Tree)addressTree.value);
		}
Пример #7
0
 public virtual object[] ToArray(object[] array)
 {
     Tree.Traverse(_tree, new _IVisitor4_43(array));
     return(array);
 }