Class ShallowCopy

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

public class ShallowCopy extends Object implements Visitor
"Clones" a BioPAX element - using direct properties and dependent children only. (shallow copy). Compare to Fetcher
See Also:
  • Constructor Details

    • ShallowCopy

      public ShallowCopy(EditorMap map)
      Deprecated.
      use Level based constructor instead.
      Editor map based constructor.
      Parameters:
      map - that determines the BioPAX Level
    • ShallowCopy

      public ShallowCopy(BioPAXLevel level)
      BioPAXLevel based constructor
      Parameters:
      level - used for the cloning operation.
    • ShallowCopy

      public ShallowCopy()
      Empty constructos that defaults to BioPAX L3.
  • Method Details

    • copy

      public <T extends BioPAXElement> T copy(Model model, T source, String newID)
      Creates a copy of the BioPAX object with all its properties are the same, and also adds it to a model.
      Type Parameters:
      T - BioPAX type/class of the source and copy elements
      Parameters:
      model - target biopax model
      source - a biopax object to copy
      newID - new (copy) biopax object's URI
      Returns:
      copy of the source biopax element
    • copy

      public <T extends BioPAXElement> T copy(T source, String newID)
      Returns a copy of the BioPAX element (with all the property values are same)
      Type Parameters:
      T - biopax type
      Parameters:
      source - biopax element to copy
      newID - copy biopax element's absolute URI
      Returns:
      a copy of the source biopax element
    • visit

      public void visit(BioPAXElement domain, Object range, Model model, PropertyEditor editor)
      An implementation of this method should perform a BioPAX element and editor dependent operation on the model. Examples of uses of this method include adding a BioPAX element--with all its dependent elements that can be reached via the editor--into the model, or updating an element that is equivalent to the given BioPAX element using the latter's/former's values.
      Specified by:
      visit in interface Visitor
      Parameters:
      domain - BioPAXElement which is the domain of this property
      range - Object which is the range of this property
      model - model on which the visiting operation will be done
      editor - editor