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); } }
public FPTreeNode(string name, FPItem item) { mName = name; mOwner = item; mParent = null; mSameNameNextNode = null; mCount = 0; mChildren = new List <FPTreeNode>(); }
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); }
public void AddItem(FPItem item, bool duplicate) { if (duplicate) { mItems.Add(item); } else { if (!ContainItem(item)) { mItems.Add(item); } } }
public bool ContainItem(FPItem item) { int index = mItems.FindIndex(delegate(FPItem it) { return(it.mName == item.mName); }); return(index >= 0); }