Class Merger

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

public class Merger extends 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 Details

    • Merger

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

    • visit

      public void visit(BioPAXElement domain, 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 - owner
      range - property value
      model - model containing the equivalent element's equivalent
      editor - biopax property editor specific for the value type to be updated
    • getMergedElements

      public 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:
    • getAddedElements

      public 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

      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