internal void AddOccurrence(IOccurrence iocc) { if (!DepthOccSet.ContainsKey(iocc.Depth)) {// Create a container for occurrences of this depth for this pattern. DepthOccSet.Add(iocc.Depth, new DepthOccSet(iocc.Depth)); } if (DepthOccSet[iocc.Depth].ContainsOccurrence(iocc)) { throw new InvalidOperationException("Occurrence has already been added."); } if (!SupportTransactionSet.Contains(iocc.TreeId)) { SupportTransactionSet.Add(iocc.TreeId); } var newRootOcc = depthOccSet[iocc.Depth].AddOccurrence(iocc); RootSupport += newRootOcc; NumberOfRightMostOcc++; }
internal bool ContainsRootIndex(int depth, TreeId treeId, PreorderIndex rootIndex) { return(DepthOccSet.ContainsKey(depth) && (DepthOccSet[depth].ContainsRootIndex(treeId, rootIndex))); }
internal bool ContainsTreeAtDepth(Depth depth, TreeId treeId) { return(DepthOccSet.ContainsKey(depth) && DepthOccSet[depth].ContainsTree(treeId)); }
internal bool ContainsDepth(Depth depth) { return(DepthOccSet.ContainsKey(depth)); }