edu.iastate.metnet.dao
Class MyVersionGraph

java.lang.Object
  extended by edu.iastate.metnet.dao.MyVersionGraph
All Implemented Interfaces:
java.io.Serializable

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

a simple graph structure supporting transfering over network.

Author:
Jie Li
See Also:
Serialized Form

Constructor Summary
MyVersionGraph()
          default constructor
 
Method Summary
 void addOldNewLink(java.lang.Integer oldRecordId, java.lang.Integer newRecordId)
          add a version relation
 void addVersion(java.lang.Integer recordId)
          add a new version
 java.util.ArrayList getDownstreamNodeIdList(java.lang.Integer recordId)
          get the list of new version record
 java.util.ArrayList getUpstreamNodeIdList(java.lang.Integer recordId)
          get the list of old version record
 java.util.Map getVersionNodeMap()
           
 boolean isEmpty()
          if there is any history records
 int size()
          get the node size of the version, to handle if there is not any history record.
 java.lang.String toPresentation()
          get the stringization of this instance, same as toString() but use different method name to prevent name conflication
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyVersionGraph

public MyVersionGraph()
default constructor

Method Detail

addVersion

public void addVersion(java.lang.Integer recordId)
add a new version

Parameters:
recordId - the record id to be added

size

public int size()
get the node size of the version, to handle if there is not any history record.

Returns:
the size of history nodes

isEmpty

public boolean isEmpty()
if there is any history records

Returns:
true if no history record

addOldNewLink

public void addOldNewLink(java.lang.Integer oldRecordId,
                          java.lang.Integer newRecordId)
add a version relation

Parameters:
oldRecordId - the record id of old record
newRecordId - the record id of new record

getDownstreamNodeIdList

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

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

getUpstreamNodeIdList

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

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

toPresentation

public java.lang.String toPresentation()
get the stringization of this instance, same as toString() but use different method name to prevent name conflication

Returns:
the stringization nof the MyVersionGraph instance

getVersionNodeMap

public java.util.Map getVersionNodeMap()
Returns:
Returns the versionNodeMap.