Class AbstractGraph

java.lang.Object
org.biopax.paxtools.query.model.AbstractGraph
All Implemented Interfaces:
Graph
Direct Known Subclasses:
GraphL3, GraphL3Undirected

public abstract class AbstractGraph extends Object implements Graph
Adapter class for a graph that is queried.
Author:
Ozgun Babur
  • Field Details

    • objectMap

      protected Map<String,GraphObject> objectMap
      Objects are stored in this map. getKey method of objects is used for generating the key.
  • Constructor Details

    • AbstractGraph

      protected AbstractGraph()
      Empty constructor that initializes the object map.
  • Method Details

    • getGraphObject

      public GraphObject getGraphObject(Object obj)
      Gets the related wrapper for the given object, creates the wrapper if not created before.
      Specified by:
      getGraphObject in interface Graph
      Parameters:
      obj - Object to wrap
      Returns:
      wrapper
    • getGraphObject

      public GraphObject getGraphObject(String id)
      Gets the wrapper object with its id (key).
      Parameters:
      id - Whatever getKey method return for the wrapped object.
      Returns:
      Wrapper
    • getObjectMap

      public Map<String,GraphObject> getObjectMap()
      Returns:
      The object map
    • clear

      public void clear()
      Clears memory of all wrapper in the object map.
      Specified by:
      clear in interface Graph
    • getKey

      public abstract String getKey(Object wrapped)
      Parameters:
      wrapped - Object to wrap
      Returns:
      A key for the object to map it to its wrapper
    • wrap

      public abstract Node wrap(Object obj)
      Creates the wrapper for the given object.
      Parameters:
      obj - Object to wrap
      Returns:
      The wrapper