org.biopax.paxtools.controller
Class Merger

java.lang.Object
  extended by org.biopax.paxtools.controller.Merger
All Implemented Interfaces:
Visitor

public class Merger
extends java.lang.Object
implements Visitor

Utility class to merge multiple biopax models into one. Note that this merger does not preserve the integrity of the passed models. Target will be a merged model and source will become unusable.


Constructor Summary
Merger(EditorMap map)
           
 
Method Summary
 java.util.HashSet<BioPAXElement> getAddedElements()
          After a merge is accomplished, this set will contain the newly added elements.
 java.util.HashSet<BioPAXElement> getMergedElements()
          After a merge is accomplished, this set will contain the merged elements.
 void merge(Model target, Model... sources)
          Merges the source models into target model.
 void visit(BioPAXElement domain, java.lang.Object range, Model model, PropertyEditor editor)
          Checks whether model contains bpe element, and if it does, then it updates the value of the equivalent element for bpe by using the specific editor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Merger

public Merger(EditorMap map)
Parameters:
map - a class to editor map containing the editors for the elements of models to be modified.
Method Detail

visit

public void visit(BioPAXElement domain,
                  java.lang.Object range,
                  Model model,
                  PropertyEditor editor)
Checks whether model contains bpe element, and if it does, then it updates the value of the equivalent element for bpe by using the specific editor.

Specified by:
visit in interface Visitor
Parameters:
domain -
range -
model - model containing the equivalent element's equivalent
editor - editor specific for the value type to be updated

getMergedElements

public java.util.HashSet<BioPAXElement> getMergedElements()
After a merge is accomplished, this set will contain the merged elements. This is not an essential method for paxtools functionality, but it may be useful for 3rd party applications.

Returns:
a hashet of merged elements in the target
See Also:
merge(org.biopax.paxtools.model.Model, org.biopax.paxtools.model.Model...)

getAddedElements

public java.util.HashSet<BioPAXElement> getAddedElements()
After a merge is accomplished, this set will contain the newly added elements. This is not an essential method for paxtools functionallity, but it may be useful for 3rd party applications.

Returns:
a hashet of newly added elements in the target
See Also:
merge(org.biopax.paxtools.model.Model, org.biopax.paxtools.model.Model...)

merge

public void merge(Model target,
                  Model... sources)
Merges the source models into target model.

Parameters:
target - model into which merging process will be done
sources - model(s) that are going to be merged with target


Copyright © 2011 BioPAX. All Rights Reserved.