edu.iastate.metnet.export
Class MyPathwayGraph

java.lang.Object
  extended by edu.iastate.metnet.export.MyPathwayGraph
All Implemented Interfaces:
java.io.Serializable

public class MyPathwayGraph
extends java.lang.Object
implements java.io.Serializable

a simple pathway graph to detect the structure change. Like version graph, we store the element here but the adjacency list in node itself

Author:
Jie Li
See Also:
Serialized Form

Constructor Summary
MyPathwayGraph()
          default constructor
 
Method Summary
 void addEdge(java.lang.Integer leftId, java.lang.Integer rightId)
           
 void addNode(PathwayElementNode node)
          add an element
 java.util.ArrayList getDownstreamEntityNodeIdList(java.lang.Integer blockId)
          get the downstream entity node id list
 java.util.ArrayList getDownstreamInteractionNodeIdList(java.lang.Integer blockId)
          get the downstream interaction node id list
 java.util.ArrayList getDownstreamNodeIdList(java.lang.Integer blockId)
          get the list of new version record
 java.util.Map getNodeMap()
           
 java.util.ArrayList getUpstreamEntityNodeIdList(java.lang.Integer blockId)
          get the upstream entity node id list
 java.util.ArrayList getUpstreamInteractionNodeIdList(java.lang.Integer blockId)
          get the upstream interaction node id list
 java.util.ArrayList getUpstreamNodeIdList(java.lang.Integer blockId)
          get the list of old version record
 boolean isControlInteraction(java.lang.Integer blockId)
          if this is a control interaction
 boolean isEntitywithlocation(java.lang.Integer blockId)
          if it is an entitywithlocation
 boolean isInteraction(java.lang.Integer blockId)
          if it is an interaction
 boolean isNormalInteraction(java.lang.Integer blockId)
          if it is a normal interaction
 void removeNode(java.lang.Integer nodeId)
          remove a node from the pathway structure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyPathwayGraph

public MyPathwayGraph()
default constructor

Method Detail

addNode

public void addNode(PathwayElementNode node)
add an element

Parameters:
node - the structure node information

removeNode

public void removeNode(java.lang.Integer nodeId)
remove a node from the pathway structure

Parameters:
nodeId - the node id of the pathway element

isEntitywithlocation

public boolean isEntitywithlocation(java.lang.Integer blockId)
                             throws NoSuchNodeException
if it is an entitywithlocation

Parameters:
blockId - the blockid of the entitywithlocation
Returns:
true if it is an entitywithlocation, false if not
Throws:
NoSuchNodeException - the node id does not exist

isInteraction

public boolean isInteraction(java.lang.Integer blockId)
                      throws NoSuchNodeException
if it is an interaction

Parameters:
blockId - the blockid of the node
Returns:
true if it is an interaction, false if not
Throws:
NoSuchNodeException - the node id does not exist

isNormalInteraction

public boolean isNormalInteraction(java.lang.Integer blockId)
                            throws NoSuchNodeException
if it is a normal interaction

Parameters:
blockId - the blockid of the node
Returns:
true if it is a normal interaction, false if not
Throws:
NoSuchNodeException - the node id does not exist

isControlInteraction

public boolean isControlInteraction(java.lang.Integer blockId)
                             throws NoSuchNodeException
if this is a control interaction

Parameters:
blockId - the blockid of current node
Returns:
true if it is a control interaction, false if not
Throws:
NoSuchNodeException - the node id does not exist

getDownstreamNodeIdList

public java.util.ArrayList getDownstreamNodeIdList(java.lang.Integer blockId)
get the list of new version record

Parameters:
blockId - the record id to be query
Returns:
the list of new version record id

getUpstreamNodeIdList

public java.util.ArrayList getUpstreamNodeIdList(java.lang.Integer blockId)
get the list of old version record

Parameters:
blockId - the recordid to be query
Returns:
the list of old version record id

getUpstreamEntityNodeIdList

public java.util.ArrayList getUpstreamEntityNodeIdList(java.lang.Integer blockId)
get the upstream entity node id list

Parameters:
blockId - the current node id
Returns:
the upstream entity node id list

getDownstreamEntityNodeIdList

public java.util.ArrayList getDownstreamEntityNodeIdList(java.lang.Integer blockId)
get the downstream entity node id list

Parameters:
blockId - the current node id
Returns:
the downstream entity node id list

getUpstreamInteractionNodeIdList

public java.util.ArrayList getUpstreamInteractionNodeIdList(java.lang.Integer blockId)
get the upstream interaction node id list

Parameters:
blockId - the current node id
Returns:
the upstream interaction node id list

getDownstreamInteractionNodeIdList

public java.util.ArrayList getDownstreamInteractionNodeIdList(java.lang.Integer blockId)
get the downstream interaction node id list

Parameters:
blockId - the current node id
Returns:
the downstream interaction node id list

addEdge

public void addEdge(java.lang.Integer leftId,
                    java.lang.Integer rightId)
             throws NoSuchNodeException
Throws:
NoSuchNodeException

getNodeMap

public java.util.Map getNodeMap()
Returns:
Returns the nodeMap.