Package org.biopax.paxtools.query.model
Class AbstractGraph
java.lang.Object
org.biopax.paxtools.query.model.AbstractGraph
- All Implemented Interfaces:
Graph
- Direct Known Subclasses:
GraphL3,GraphL3Undirected
Adapter class for a graph that is queried.
- Author:
- Ozgun Babur
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,GraphObject> Objects are stored in this map. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEmpty constructor that initializes the object map. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears memory of all wrapper in the object map.getGraphObject(Object obj) Gets the related wrapper for the given object, creates the wrapper if not created before.getGraphObject(String id) Gets the wrapper object with its id (key).abstract Stringabstract NodeCreates the wrapper for the given object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.biopax.paxtools.query.model.Graph
getWrappedSet, getWrapperMap, getWrapperSet
-
Field Details
-
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
Gets the related wrapper for the given object, creates the wrapper if not created before.- Specified by:
getGraphObjectin interfaceGraph- Parameters:
obj- Object to wrap- Returns:
- wrapper
-
getGraphObject
Gets the wrapper object with its id (key).- Parameters:
id- Whatever getKey method return for the wrapped object.- Returns:
- Wrapper
-
getObjectMap
- Returns:
- The object map
-
clear
public void clear()Clears memory of all wrapper in the object map. -
getKey
- Parameters:
wrapped- Object to wrap- Returns:
- A key for the object to map it to its wrapper
-
wrap
Creates the wrapper for the given object.- Parameters:
obj- Object to wrap- Returns:
- The wrapper
-