Exemplo n.º 1
0
        void AddNodes(FPTreeNode ancestor, Queue <FPItem> record, FPNodeHeadTable nodeTable)
        {
            int size = record.Count;

            if (size > 0)
            {
                FPItem     item = record.Dequeue();
                FPTreeNode node = item.CreateNode();
                node.mCount  = 1;
                node.mParent = ancestor;
                ancestor.AddChild(node);
                int        count    = nodeTable.Size();
                FPTreeNode tempNode = null;
                for (int j = 0; j < count; ++j)
                {
                    tempNode = nodeTable.At(j);
                    if (tempNode.mName == node.mName)
                    {
                        node.NextNode     = tempNode.NextNode;
                        tempNode.NextNode = node;
                        //while (tempNode.NextNode != null)
                        //{
                        //    tempNode = tempNode.NextNode;
                        //}
                        //tempNode.NextNode = node;
                        break;
                    }
                }
                AddNodes(node, record, nodeTable);
            }
        }
Exemplo n.º 2
0
 public FPTreeNode(string name, FPItem item)
 {
     mName             = name;
     mOwner            = item;
     mParent           = null;
     mSameNameNextNode = null;
     mCount            = 0;
     mChildren         = new List <FPTreeNode>();
 }
Exemplo n.º 3
0
        private static FPTransition ParseArrayToTransition(FPTransitions transitions, List <string> sourceArray)
        {
            FPTransition transition = new FPTransition();
            int          size       = sourceArray.Count;

            for (int i = 0; i < size; ++i)
            {
                FPItem item = ParseStringToItem(transitions, sourceArray[i]);
                transition.AddItem(item, transitions.mDuplicate);
            }
            return(transition);
        }
Exemplo n.º 4
0
 public void AddItem(FPItem item, bool duplicate)
 {
     if (duplicate)
     {
         mItems.Add(item);
     }
     else
     {
         if (!ContainItem(item))
         {
             mItems.Add(item);
         }
     }
 }
Exemplo n.º 5
0
        public bool ContainItem(FPItem item)
        {
            int index = mItems.FindIndex(delegate(FPItem it) { return(it.mName == item.mName); });

            return(index >= 0);
        }