edu.iu.iv.modeling.tarl.output.impl
Class JUNGGraphGenerator

java.lang.Object
  |
  +--edu.iu.iv.modeling.tarl.output.impl.JUNGGraphGenerator
All Implemented Interfaces:
GraphGenerator

public class JUNGGraphGenerator
extends java.lang.Object
implements GraphGenerator

Author:
Team IVC

Constructor Summary
JUNGGraphGenerator(PublicationManager pubManager, AuthorManager authorManager)
          Constructs a graph generator using the specified publication and author managers.
 
Method Summary
 java.lang.Object generateAuthorPublicationGraph(java.lang.Object authorGraph, java.lang.Object publicationGraph)
          Generates a author-publication graph of type JUNG Graph (edu.uci.ics.jung.graph.Graph) This graph has two types of vertices, one type representing the authors and another type representing the papers.
 java.lang.Object generateCitationGraph()
          Generates a co-citation graph of type JUNG Graph (edu.uci.ics.jung.graph.Graph) using the publication manager.
 java.lang.Object generateCoAuthorGraph()
          Generates a co-author graph of type JUNG Graph (edu.uci.ics.jung.graph.Graph) using the author manager.
 java.lang.Class getGraphClass()
           
 void setAuthorManager(AuthorManager authorManager)
          Set the author manager for this generator.
 void setPublicationManager(PublicationManager pubManager)
          Set the publication manager for this generator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JUNGGraphGenerator

public JUNGGraphGenerator(PublicationManager pubManager,
                          AuthorManager authorManager)
Constructs a graph generator using the specified publication and author managers.

Parameters:
pubManager - The publication manager to use for publications.
authorManager - The author manager to use for authors.
Method Detail

getGraphClass

public java.lang.Class getGraphClass()
Specified by:
getGraphClass in interface GraphGenerator
Returns:
The class of the object returned by the implementation of the GraphGenerator.

generateAuthorPublicationGraph

public java.lang.Object generateAuthorPublicationGraph(java.lang.Object authorGraph,
                                                       java.lang.Object publicationGraph)
Generates a author-publication graph of type JUNG Graph (edu.uci.ics.jung.graph.Graph) This graph has two types of vertices, one type representing the authors and another type representing the papers. The return value should be type cast to to this Graph object in order to use it as a graph. Adds keys to user data of the resulting authPubGraph to enable identification of the type of vertex as being an author or a publication. Procedure to process this graph:
Object VERTEX_TYPE_KEY = authPubGraph.getUserDatum("Vertex Type Key") ; Object AUTHOR_TYPE = new String("Author") ; Object PUBLICATION_TYPE = new String("Publication") ; FOR EACH Vertex vertex = authPubGraph.getVertex() ; // get some vertex

Specified by:
generateAuthorPublicationGraph in interface GraphGenerator
Returns:
The author-publication network.
See Also:
edu.iu.iv.modeling.tarl.output.GraphGenerator#generateAuthorPublicationGraph()

generateCoAuthorGraph

public java.lang.Object generateCoAuthorGraph()
Generates a co-author graph of type JUNG Graph (edu.uci.ics.jung.graph.Graph) using the author manager. The return value should be type cast to this Graph object in order to use it as a graph.
Algorithm :
 	FOR EACH author IN authorManager.getAuthors() 
 		FOR EACH pub IN pubManager.getPublications()
 			IF author IS IN pub.getAuthors() 
 				graph.addEdge(author, <AllOtherAuthors>) ;
 			ENDIF 
 		ENDFOR 
 ENDFOR
 

Specified by:
generateCoAuthorGraph in interface GraphGenerator
Returns:
The co-author network.
See Also:
GraphGenerator.generateCoAuthorGraph()

generateCitationGraph

public java.lang.Object generateCitationGraph()
Generates a co-citation graph of type JUNG Graph (edu.uci.ics.jung.graph.Graph) using the publication manager. The return value should be type cast to to this Graph object in order to use it as a graph.
 		FOR pub IN pubManager.getPublications()
 			FOR citedPub IN pub.getCitedPublications()
 				graph.addEdge(pub, citedPub) ;
 			ENDFOR
 		ENDFOR
 

Specified by:
generateCitationGraph in interface GraphGenerator
Returns:
The co-citation network.
See Also:
GraphGenerator.generateCitationGraph()

setAuthorManager

public void setAuthorManager(AuthorManager authorManager)
Description copied from interface: GraphGenerator
Set the author manager for this generator. This manager is used to access the authors in the model.

Specified by:
setAuthorManager in interface GraphGenerator
Parameters:
authorManager -
See Also:
edu.iu.iv.modeling.tarl.output.GraphGenerator#setAuthorManager(edu.iu.iv.modeling.tarl.author.AuthorManagerInterface)

setPublicationManager

public void setPublicationManager(PublicationManager pubManager)
Description copied from interface: GraphGenerator
Set the publication manager for this generator. This manager is used to access the publications in the model.

Specified by:
setPublicationManager in interface GraphGenerator
Parameters:
pubManager -
See Also:
edu.iu.iv.modeling.tarl.output.GraphGenerator#setPublicationManager(edu.iu.iv.modeling.tarl.publication.PublicationManagerInterface)