edu.ksu.cis.kdd.util.graph
Class Graph

java.lang.Object
  extended bysalvo.jesus.graph.GraphImpl
      extended bysalvo.jesus.graph.DirectedGraphImpl
          extended bysalvo.jesus.graph.DirectedAcyclicGraphImpl
              extended byedu.ksu.cis.kdd.util.graph.Graph
All Implemented Interfaces:
salvo.jesus.graph.DirectedAcyclicGraph, salvo.jesus.graph.DirectedGraph, salvo.jesus.graph.Graph, HasProperty, java.io.Serializable
Direct Known Subclasses:
BBNGraph, CliqueTree

public class Graph
extends salvo.jesus.graph.DirectedAcyclicGraphImpl
implements HasProperty

Wrapper for OpenJGraph

Author:
Roby Joehanes
See Also:
Serialized Form

Field Summary
protected  java.lang.String name
           
protected  java.util.Hashtable nodeTable
           
protected  java.util.Hashtable property
           
 
Fields inherited from class salvo.jesus.graph.GraphImpl
factory, traversal
 
Constructor Summary
Graph()
           
 
Method Summary
 void add(salvo.jesus.graph.Vertex v)
          Adding vertex override to accomodate retrieval under certain name.
 salvo.jesus.graph.Edge addEdge(salvo.jesus.graph.Vertex v1, salvo.jesus.graph.Vertex v2)
          Tell the user not to use this addEdge(Vertex, Vertex)
 void addNode(salvo.jesus.graph.Vertex v)
          An alias to add(Vertex)
 void addNodes(java.util.Collection c)
          Add multiple nodes at once.
 boolean containsNode(Node v)
           
 boolean equals(java.lang.Object o)
          Equals
 TableSet getAdjacencyList()
          Construct the adjacency list table for a particular graph.
 java.util.Set getEdges()
          Return the set of edges.
 int getError(Graph goldGraph)
           
 java.lang.String getName()
          Returns the name.
 Node getNode(java.lang.String name)
          Get node called name.
 java.util.List getNodeList()
           
 java.util.Set getNodeNames()
          Returns the set of node names
 java.util.Set getNodes()
           
 java.util.Hashtable getProperty()
          Returns the property.
 java.lang.Object getProperty(java.lang.Object p)
          Get the property value with key p.
 TableSet getReverseAdjacencyList()
          Construct the adjacency list table for a particular graph.
 int hashCode()
           
 void putProperty(java.lang.Object p, java.lang.Object v)
          Put the property p with value v
 void remove(salvo.jesus.graph.Vertex v)
          Remove a node
 void removeEdge(salvo.jesus.graph.Vertex v1, salvo.jesus.graph.Vertex v2)
           
 void removeNode(salvo.jesus.graph.Vertex v)
          Remove a node.
 void removeProperty(java.lang.Object p)
          Remove the property with key p.
 void setName(java.lang.String name)
          Sets the name.
 void setProperty(java.util.Hashtable property)
          Sets the property.
 java.lang.String toString()
           
 
Methods inherited from class salvo.jesus.graph.DirectedAcyclicGraphImpl
getRoot, reverseTopologicalSort, reverseTopologicalSort, topologicalSort, topologicalSort
 
Methods inherited from class salvo.jesus.graph.DirectedGraphImpl
getEdge, getIncomingAdjacentVertices, getIncomingEdges, getOutgoingAdjacentVertices, getOutgoingEdges, isCycle, isPath
 
Methods inherited from class salvo.jesus.graph.GraphImpl
addEdge, addGraphAddEdgeListener, addGraphAddVertexListener, addGraphRemoveEdgeListener, addGraphRemoveVertexListener, addListener, cloneVertices, containsEdge, containsVertex, forgetConnectedSets, getAdjacentVertices, getAdjacentVertices, getConnectedSet, getConnectedSet, getDegree, getDegree, getEdges, getEdgesCount, getEdgeSet, getGraphFactory, getTraversal, getVertexSet, getVertices, getVerticesCount, getVerticesIterator, isConnected, removeEdge, removeEdges, removeGraphAddEdgeListener, removeGraphAddVertexListener, removeGraphRemoveEdgeListener, removeGraphRemoveVertexListener, removeListener, setGraphFactory, setTraversal, traverse
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface salvo.jesus.graph.DirectedGraph
getEdge, getIncomingAdjacentVertices, getIncomingEdges, getOutgoingAdjacentVertices, getOutgoingEdges, isCycle, isPath
 
Methods inherited from interface salvo.jesus.graph.Graph
addEdge, addGraphAddEdgeListener, addGraphAddVertexListener, addGraphRemoveEdgeListener, addGraphRemoveVertexListener, addListener, cloneVertices, getAdjacentVertices, getAdjacentVertices, getConnectedSet, getConnectedSet, getDegree, getDegree, getEdges, getEdgesCount, getEdgeSet, getGraphFactory, getTraversal, getVertexSet, getVertices, getVerticesCount, getVerticesIterator, isConnected, removeEdge, removeEdges, removeGraphAddEdgeListener, removeGraphAddVertexListener, removeGraphRemoveEdgeListener, removeGraphRemoveVertexListener, removeListener, setGraphFactory, setTraversal, traverse
 

Field Detail

name

protected java.lang.String name

nodeTable

protected java.util.Hashtable nodeTable

property

protected java.util.Hashtable property
Constructor Detail

Graph

public Graph()
Method Detail

add

public void add(salvo.jesus.graph.Vertex v)
Adding vertex override to accomodate retrieval under certain name.

Specified by:
add in interface salvo.jesus.graph.Graph
See Also:
Graph.add(Vertex)

addNode

public void addNode(salvo.jesus.graph.Vertex v)
An alias to add(Vertex)

Parameters:
v -

addNodes

public void addNodes(java.util.Collection c)
Add multiple nodes at once. A shortcut

Parameters:
c -

addEdge

public salvo.jesus.graph.Edge addEdge(salvo.jesus.graph.Vertex v1,
                                      salvo.jesus.graph.Vertex v2)
Tell the user not to use this addEdge(Vertex, Vertex)

Specified by:
addEdge in interface salvo.jesus.graph.Graph
See Also:
Graph.addEdge(Vertex, Vertex)

containsNode

public boolean containsNode(Node v)
See Also:
GraphImpl.containsVertex(Vertex)

remove

public void remove(salvo.jesus.graph.Vertex v)
Remove a node

Specified by:
remove in interface salvo.jesus.graph.Graph
See Also:
Graph.remove(Vertex)

removeNode

public void removeNode(salvo.jesus.graph.Vertex v)
Remove a node. Same as remove

Parameters:
v -

removeEdge

public void removeEdge(salvo.jesus.graph.Vertex v1,
                       salvo.jesus.graph.Vertex v2)

getNode

public Node getNode(java.lang.String name)
Get node called name.

Parameters:
name -
Returns:
Node

getNodes

public java.util.Set getNodes()
See Also:
Graph.getVertexSet()

getNodeList

public java.util.List getNodeList()

getNodeNames

public java.util.Set getNodeNames()
Returns the set of node names

Returns:
Set

getEdges

public java.util.Set getEdges()
Return the set of edges. Just an alias of getEdgeSet().

Returns:
Set

getName

public java.lang.String getName()
Returns the name.

Returns:
String

setName

public void setName(java.lang.String name)
Sets the name.

Parameters:
name - The name to set

equals

public boolean equals(java.lang.Object o)
Equals

See Also:
Object.equals(Object)

hashCode

public int hashCode()
See Also:
Object.hashCode()

toString

public java.lang.String toString()
See Also:
Object.toString()

getProperty

public java.util.Hashtable getProperty()
Returns the property.

Specified by:
getProperty in interface HasProperty
Returns:
Hashtable

setProperty

public void setProperty(java.util.Hashtable property)
Sets the property.

Specified by:
setProperty in interface HasProperty
Parameters:
property - The property to set

getProperty

public java.lang.Object getProperty(java.lang.Object p)
Get the property value with key p.

Specified by:
getProperty in interface HasProperty
Parameters:
p -
Returns:
Object

putProperty

public void putProperty(java.lang.Object p,
                        java.lang.Object v)
Put the property p with value v

Specified by:
putProperty in interface HasProperty
Parameters:
p -
v -

removeProperty

public void removeProperty(java.lang.Object p)
Remove the property with key p.

Specified by:
removeProperty in interface HasProperty
Parameters:
p -

getAdjacencyList

public TableSet getAdjacencyList()
Construct the adjacency list table for a particular graph. It is a table of Node -> Children


getReverseAdjacencyList

public TableSet getReverseAdjacencyList()
Construct the adjacency list table for a particular graph. It is a table of Node -> Parents


getError

public int getError(Graph goldGraph)