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