org.biopax.paxtools.controller
Class Fetcher

java.lang.Object
  extended by org.biopax.paxtools.controller.Traverser
      extended by org.biopax.paxtools.controller.AbstractTraverser
          extended by org.biopax.paxtools.controller.Fetcher
All Implemented Interfaces:
Visitor

public class Fetcher
extends AbstractTraverser

This class is used to fetch an element (traverse it to obtain its dependent elements) and to add this element into a model using the visitor and traverse functions. FIXME may fail (StackOverFlow) when there is a cycle (see AbstractTraverser; use s.util.Filter)

See Also:
Visitor, Traverser

Field Summary
 
Fields inherited from class org.biopax.paxtools.controller.Traverser
editorMap, filters, log, visitor
 
Constructor Summary
Fetcher(EditorMap editorMap, Filter<PropertyEditor>... filters)
           
 
Method Summary
 java.util.Set<BioPAXElement> fetch(BioPAXElement element)
          Returns the element and all its children set.
 void fetch(BioPAXElement element, Model model)
          Adds the element and all its children to the model.
protected  void visit(java.lang.Object range, BioPAXElement domain, Model model, PropertyEditor editor)
          Adds the BioPAX element into the model and traverses the element for its dependent elements.
 
Methods inherited from class org.biopax.paxtools.controller.AbstractTraverser
getVisited, visit
 
Methods inherited from class org.biopax.paxtools.controller.Traverser
filter, getVisitor, setVisitor, traverse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fetcher

public Fetcher(EditorMap editorMap,
               Filter<PropertyEditor>... filters)
Method Detail

visit

protected void visit(java.lang.Object range,
                     BioPAXElement domain,
                     Model model,
                     PropertyEditor editor)
Adds the BioPAX element into the model and traverses the element for its dependent elements.

Specified by:
visit in class AbstractTraverser
Parameters:
range - is property value
domain - is parent BioPAX element
editor - is the property editor

fetch

public void fetch(BioPAXElement element,
                  Model model)
Adds the element and all its children to the model. This method fails if there are different child objects with the same ID, because normally a good (self-consistent) model does not contain duplicate BioPAX elements. Consider using fetch(BioPAXElement) method instead if you want to get all the child elements anyway.

Parameters:
element - the BioPAX element to be added into the model
model - model into which elements will be added

fetch

public java.util.Set<BioPAXElement> fetch(BioPAXElement element)
Returns the element and all its children set. (This method can return different objects with the same ID!)

Parameters:
element -
model -


Copyright © 2011 BioPAX. All Rights Reserved.