edu.cs.ai.kreator.logic
Class ClauseNetworkNode

java.lang.Object
  extended by edu.cs.ai.kreator.logic.ClauseNetworkNode

public class ClauseNetworkNode
extends java.lang.Object

This class represents a node in a clause network, i.e. a ground clause with some graph theoretical auxiliary stuff.

Author:
Matthias Thimm

Constructor Summary
ClauseNetworkNode(Clause clause)
          Creates a new node for the given clause.
 
Method Summary
protected  void addChild(ClauseNetworkNode node)
          Adds the given node to this node's children.
protected  void addParent(ClauseNetworkNode node)
          Adds the given node to this node's parents.
 boolean equals(java.lang.Object obj)
           
 java.util.Set<ClauseNetworkNode> getChildren()
          Returns the children of this node.
 Clause getClause()
          Returns the clause of this node.
 java.util.Set<ClauseNetworkNode> getParents()
          Returns the parents of this node.
 int hashCode()
           
 boolean isLeafNode()
          Checks whether this node is a root leaf, i.e.
 boolean isRootNode()
          Checks whether this node is a root node, i.e.
protected  void removeChild(ClauseNetworkNode node)
          Removes the given node from this node's children (if present),
protected  void removeParent(ClauseNetworkNode node)
          Removes the given node from this node's parents (if present),
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClauseNetworkNode

public ClauseNetworkNode(Clause clause)
Creates a new node for the given clause.

Parameters:
clause - a clause.
Method Detail

getClause

public Clause getClause()
Returns the clause of this node.

Returns:
the clause of this node.

isRootNode

public boolean isRootNode()
Checks whether this node is a root node, i.e. whether it has no parents.

Returns:
"true" if this node is a root node.

isLeafNode

public boolean isLeafNode()
Checks whether this node is a root leaf, i.e. whether it has no children.

Returns:
"true" if this node is a leaf node.

getParents

public java.util.Set<ClauseNetworkNode> getParents()
Returns the parents of this node.

Returns:
the parents of this node.

getChildren

public java.util.Set<ClauseNetworkNode> getChildren()
Returns the children of this node.

Returns:
the children of this node.

addParent

protected void addParent(ClauseNetworkNode node)
Adds the given node to this node's parents.

Parameters:
node - a node.

addChild

protected void addChild(ClauseNetworkNode node)
Adds the given node to this node's children.

Parameters:
node - a node.

removeChild

protected void removeChild(ClauseNetworkNode node)
Removes the given node from this node's children (if present),

Parameters:
node -

removeParent

protected void removeParent(ClauseNetworkNode node)
Removes the given node from this node's parents (if present),

Parameters:
node -

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object