org.semwebcentral.sweetrules.analyzer
Class SweetPDGNode

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

public class SweetPDGNode
extends java.lang.Object

Created on Nov 5, 2004 Represents a Predicate dependency graph node

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

Field Summary
private  java.util.Hashtable negativeInSuperGoalNodes
          The predicates on which this node depends
private  java.util.Hashtable negativeSubGoalNodes
          The predicates on which this node depends
private  SweetPredicate nodePredicate
          The predicate associated with this node
private  java.util.Hashtable positiveInSuperGoalNodes
          The predicates which depend on this node in a positive fashion
private  java.util.Hashtable positiveSubGoalNodes
          The predicates on which this node depends
 
Constructor Summary
SweetPDGNode(SweetPredicate predicate)
          Constructor for a node in the predicate dependency graph
 
Method Summary
 void addNegativeInSuperGoalNode(SweetPDGNode goalNode)
          Adds a node for which this node appears as a -ve subgoal in some rule
 void addNegativeSubGoalNode(SweetPDGNode subGoalNode)
          Adds a node which appears as a negative sub goal for this node in some rule
 void addPositiveInSuperGoalNode(SweetPDGNode goalNode)
          Adds a node for which this node appears as a +ve subgoal in some rule
 void addPositiveSubGoalNode(SweetPDGNode subGoalNode)
          Adds a node which appears as a positive sub goal for this node in some rule
private  boolean existsPredicateInVector(SweetPDGNode candidateNode, java.util.Vector pdgNodeVector)
          Utility that checks if the predicate of a given node exists in the vector specified
 SweetPDGNode[] getNegativeInSuperGoalNodes()
           
 SweetPDGNode[] getNegativeSubGoalNodes()
           
 SweetPredicate getNodePredicate()
           
 SweetPDGNode[] getPositiveInSuperGoalNodes()
           
 SweetPDGNode[] getPositiveSubGoalNodes()
           
 boolean hasSameNodePredicate(SweetPDGNode othernode)
          Tests if two nodes have the same node predicate
 void setNodePredicate(SweetPredicate nodePredicate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

positiveInSuperGoalNodes

private java.util.Hashtable positiveInSuperGoalNodes
The predicates which depend on this node in a positive fashion


positiveSubGoalNodes

private java.util.Hashtable positiveSubGoalNodes
The predicates on which this node depends


negativeInSuperGoalNodes

private java.util.Hashtable negativeInSuperGoalNodes
The predicates on which this node depends


negativeSubGoalNodes

private java.util.Hashtable negativeSubGoalNodes
The predicates on which this node depends


nodePredicate

private SweetPredicate nodePredicate
The predicate associated with this node

Constructor Detail

SweetPDGNode

public SweetPDGNode(SweetPredicate predicate)
Constructor for a node in the predicate dependency graph

Parameters:
predicate - The predicate corresponding to this node
Method Detail

addPositiveSubGoalNode

public void addPositiveSubGoalNode(SweetPDGNode subGoalNode)
Adds a node which appears as a positive sub goal for this node in some rule

Parameters:
subGoalNode - The subgoal node to add

addNegativeSubGoalNode

public void addNegativeSubGoalNode(SweetPDGNode subGoalNode)
Adds a node which appears as a negative sub goal for this node in some rule

Parameters:
subGoalNode - The subgoal node to add

addPositiveInSuperGoalNode

public void addPositiveInSuperGoalNode(SweetPDGNode goalNode)
Adds a node for which this node appears as a +ve subgoal in some rule

Parameters:
goalNode - The goal node to add

addNegativeInSuperGoalNode

public void addNegativeInSuperGoalNode(SweetPDGNode goalNode)
Adds a node for which this node appears as a -ve subgoal in some rule

Parameters:
goalNode - The goal node to add

hasSameNodePredicate

public boolean hasSameNodePredicate(SweetPDGNode othernode)
Tests if two nodes have the same node predicate

Parameters:
othernode - The other node being compared
Returns:
true if the predicates of the nodes are equal

getNodePredicate

public SweetPredicate getNodePredicate()
Returns:
Returns the nodePredicate.

setNodePredicate

public void setNodePredicate(SweetPredicate nodePredicate)
Parameters:
nodePredicate - The nodePredicate to set.

getPositiveSubGoalNodes

public SweetPDGNode[] getPositiveSubGoalNodes()
Returns:
Returns the nodes which appear as +ve subgoals for this node

getNegativeSubGoalNodes

public SweetPDGNode[] getNegativeSubGoalNodes()
Returns:
Returns the nodes which appear as -ve subgoals for this node

getPositiveInSuperGoalNodes

public SweetPDGNode[] getPositiveInSuperGoalNodes()
Returns:
Returns the nodes for which this node appears as a +ve subgoal

getNegativeInSuperGoalNodes

public SweetPDGNode[] getNegativeInSuperGoalNodes()
Returns:
Returns the nodes for which this node appears as a -ve subgoal

existsPredicateInVector

private boolean existsPredicateInVector(SweetPDGNode candidateNode,
                                        java.util.Vector pdgNodeVector)
Utility that checks if the predicate of a given node exists in the vector specified

Parameters:
candidateNode - The candidate node to check
pdgNodeVector - The vector to check against
Returns:
true if the vector has the same predicate