org.semwebcentral.sweetrules.analyzer
Class SweetPredicateDependencyGraph

java.lang.Object
  extended byorg.semwebcentral.sweetrules.analyzer.SweetPredicateDependencyGraph

public class SweetPredicateDependencyGraph
extends java.lang.Object

Created on Nov 8, 2004

Author:
Shashidhara K Ganjugunte, Dr. Benjamin Grosof, Dr. Said Tabet, Chitravanu Neogy

Field Summary
private  Logger logger
          The logger object
private  java.util.Hashtable pdgNodes
          Set of PDGnodes of this graph Key is SweetPredicate object Element is the SweetPDGNode (which has the dependency info)
 
Constructor Summary
SweetPredicateDependencyGraph()
          The constructor for the Predicate Dependency Graph
 
Method Summary
 void addPDGNode(SweetPDGNode node)
          Adds a node to the PDG, overwrites if a node corresponding to the node predicate already exists
 SweetPDGNode getPDGNode(SweetPredicate predicate)
          Gets the node corresponding to a predicate
 SweetPDGNode[] getPDGNodes()
           
(package private) static SweetPDGNode[] getPDGNodesFromTable(java.util.Hashtable table)
          Utility method for getting the nodes from a Hashtable
 int getPredicateCount()
          Returns the number of predicates in the PDG
 java.lang.StringBuffer getTraceOfPDGNodes(SweetPDGNode[] pdgNodes, int tabCount)
          Helper function to get a string of trace info about the PDG nodes
 void print()
          Helper print method
 void removePDGNode(SweetPredicate nodePredicate)
          Removes the node corresponding to the specified predicate from the graph if such a node exists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pdgNodes

private java.util.Hashtable pdgNodes
Set of PDGnodes of this graph Key is SweetPredicate object Element is the SweetPDGNode (which has the dependency info)


logger

private Logger logger
The logger object

Constructor Detail

SweetPredicateDependencyGraph

public SweetPredicateDependencyGraph()
The constructor for the Predicate Dependency Graph

Method Detail

getPDGNodes

public SweetPDGNode[] getPDGNodes()
Returns:
Returns the nodes of the PDG.

getPDGNodesFromTable

static SweetPDGNode[] getPDGNodesFromTable(java.util.Hashtable table)
Utility method for getting the nodes from a Hashtable

Parameters:
table - The table from which the nodes are to be retrieved
Returns:
The nodes present in the table

getPDGNode

public SweetPDGNode getPDGNode(SweetPredicate predicate)
Gets the node corresponding to a predicate

Parameters:
predicate - The predicate whose node is to be retrieved
Returns:
The node of the predicate if it exists null otherwise

addPDGNode

public void addPDGNode(SweetPDGNode node)
Adds a node to the PDG, overwrites if a node corresponding to the node predicate already exists

Parameters:
node - The node to add

removePDGNode

public void removePDGNode(SweetPredicate nodePredicate)
Removes the node corresponding to the specified predicate from the graph if such a node exists

Parameters:
nodePredicate - The nodePredicate to check for

getPredicateCount

public int getPredicateCount()
Returns the number of predicates in the PDG

Returns:
The predicate count

print

public void print()
Helper print method


getTraceOfPDGNodes

public java.lang.StringBuffer getTraceOfPDGNodes(SweetPDGNode[] pdgNodes,
                                                 int tabCount)
Helper function to get a string of trace info about the PDG nodes

Parameters:
pdgNodes - The pdg nodes to get the info from
tabCount - The number of leading tabs
Returns:
The String representing the trace of the PDGNodes