예제 #1
0
        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++;
        }
예제 #2
0
 internal bool ContainsRootIndex(int depth, TreeId treeId, PreorderIndex rootIndex)
 {
     return(DepthOccSet.ContainsKey(depth) && (DepthOccSet[depth].ContainsRootIndex(treeId, rootIndex)));
 }
예제 #3
0
 internal bool ContainsTreeAtDepth(Depth depth, TreeId treeId)
 {
     return(DepthOccSet.ContainsKey(depth) && DepthOccSet[depth].ContainsTree(treeId));
 }
예제 #4
0
 internal bool ContainsDepth(Depth depth)
 {
     return(DepthOccSet.ContainsKey(depth));
 }