edu.berkeley.cs.db.yfilterplus.dtdscanner
Class DTDAnalyzer

java.lang.Object
  |
  +--edu.berkeley.cs.db.yfilterplus.dtdscanner.DTDAnalyzer

public class DTDAnalyzer
extends java.lang.Object


Constructor Summary
DTDAnalyzer(java.util.Hashtable elements, java.lang.String root)
           
 
Method Summary
 void analyzeElementsOnLoop()
          1) this function check for each pair of elements (can be identical), if there is a loop before them.
 void analyzeLoops()
          this function reports two types of information on dtd elements: 1) the loops in dtd and elements on a specific loop; and 2) the number of paths going from the root element to a specific element
 void findMultiplePathElements()
           
 void findSinglePathPairs()
          this function finds element pair between which there is a single path this information is complementory to elementOnLoop and multiplePathElement 1) if the start or end element in on a loop, the answer is no 2) if the end element is not a multiplePathElement, the answer is yes ignoring these trivial cases, this functions for the case that the start element is not on a loop and the end element is a multiplePathElement but not on a loop.
 java.util.ArrayList generateQueryPath(java.lang.String start, java.lang.String end)
          this function finds a query path from start to end using DFS in a graph we assume start and end correspond to different location steps
 java.lang.String getRoot()
           
 boolean isElementOnLoop(java.lang.String elementName)
           
 boolean isElementPairOnLoop(java.lang.String name, java.lang.String name2)
           
 boolean isMultiplePathElement(java.lang.String elementName)
           
 boolean isSinglePathPair(java.lang.String name, java.lang.String name2)
           
static void main(java.lang.String[] args)
           
 void printElementOnLoop()
           
 void printElementOnLoop(java.io.PrintWriter pw)
           
 void printElementPairOnLoop()
           
 void printElementPairOnLoop(java.io.PrintWriter pw)
           
 void printMultiplePathElements()
           
 void printMultiplePathElements(java.io.PrintWriter pw)
           
 void printParentChildren()
           
 void printSinglePathPairs()
           
 void printSinglePathPairs(java.io.PrintWriter pw)
           
 void readStatFromFile(java.lang.String fileName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTDAnalyzer

public DTDAnalyzer(java.util.Hashtable elements,
                   java.lang.String root)
Method Detail

getRoot

public java.lang.String getRoot()

isMultiplePathElement

public boolean isMultiplePathElement(java.lang.String elementName)

isElementOnLoop

public boolean isElementOnLoop(java.lang.String elementName)

isElementPairOnLoop

public boolean isElementPairOnLoop(java.lang.String name,
                                   java.lang.String name2)

isSinglePathPair

public boolean isSinglePathPair(java.lang.String name,
                                java.lang.String name2)

readStatFromFile

public void readStatFromFile(java.lang.String fileName)

findMultiplePathElements

public void findMultiplePathElements()

analyzeElementsOnLoop

public void analyzeElementsOnLoop()
1) this function check for each pair of elements (can be identical), if there is a loop before them. 2) then it is easy to determine if an element is on a loop -- just check if this element is ever on any loop. 3) finally all elements on a loop are determined to have multiple paths reaching them.


findSinglePathPairs

public void findSinglePathPairs()
this function finds element pair between which there is a single path this information is complementory to elementOnLoop and multiplePathElement 1) if the start or end element in on a loop, the answer is no 2) if the end element is not a multiplePathElement, the answer is yes ignoring these trivial cases, this functions for the case that the start element is not on a loop and the end element is a multiplePathElement but not on a loop.


generateQueryPath

public java.util.ArrayList generateQueryPath(java.lang.String start,
                                             java.lang.String end)
this function finds a query path from start to end using DFS in a graph we assume start and end correspond to different location steps


analyzeLoops

public void analyzeLoops()
this function reports two types of information on dtd elements: 1) the loops in dtd and elements on a specific loop; and 2) the number of paths going from the root element to a specific element


printMultiplePathElements

public void printMultiplePathElements()

printElementOnLoop

public void printElementOnLoop()

printElementPairOnLoop

public void printElementPairOnLoop()

printSinglePathPairs

public void printSinglePathPairs()

printMultiplePathElements

public void printMultiplePathElements(java.io.PrintWriter pw)

printElementOnLoop

public void printElementOnLoop(java.io.PrintWriter pw)

printElementPairOnLoop

public void printElementPairOnLoop(java.io.PrintWriter pw)

printSinglePathPairs

public void printSinglePathPairs(java.io.PrintWriter pw)

printParentChildren

public void printParentChildren()

main

public static void main(java.lang.String[] args)