org.biopax.paxtools.controller
Class AbstractTraverser

java.lang.Object
  extended by org.biopax.paxtools.controller.Traverser
      extended by org.biopax.paxtools.controller.AbstractTraverser
All Implemented Interfaces:
Visitor
Direct Known Subclasses:
Fetcher, PropertyReasoner

public abstract class AbstractTraverser
extends Traverser
implements Visitor

This is a convenience all-in-one Traverser/Visitor that keeps track in the model and prevents infinite loops. Like it's for the Traverser, there is no any particular order in which it processes properties.

Author:
rodch
See Also:
Fetcher, Traverser, Visitor

Field Summary
 
Fields inherited from class org.biopax.paxtools.controller.Traverser
editorMap, filters, log, visitor
 
Constructor Summary
AbstractTraverser(EditorMap editorMap, Filter<PropertyEditor>... filters)
           
 
Method Summary
protected  java.util.Stack<BioPAXElement> getVisited()
           
 void visit(BioPAXElement domain, java.lang.Object range, Model model, PropertyEditor editor)
          Saves/restores the current "path" of the value in the model and calls the protected abstract method visitValue that is to be implemented in subclasses of this abstract class.
protected abstract  void visit(java.lang.Object range, BioPAXElement domain, Model model, PropertyEditor editor)
          This is to implement a real action here: do something, return or continue (traverse) into properties.
 
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

AbstractTraverser

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

getVisited

protected java.util.Stack<BioPAXElement> getVisited()

visit

protected abstract void visit(java.lang.Object range,
                              BioPAXElement domain,
                              Model model,
                              PropertyEditor editor)
This is to implement a real action here: do something, return or continue (traverse) into properties.

Parameters:
range - is property value
domain - is parent BioPAX element
editor - is the property editor

visit

public void visit(BioPAXElement domain,
                  java.lang.Object range,
                  Model model,
                  PropertyEditor editor)
Saves/restores the current "path" of the value in the model and calls the protected abstract method visitValue that is to be implemented in subclasses of this abstract class.

Specified by:
visit in interface Visitor
Parameters:
domain - BioPAX Element
range - property value (can be BioPAX element, primitive, enum, string)
model -
editor - parent's property PropertyEditor


Copyright © 2011 BioPAX. All Rights Reserved.