|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biopax.paxtools.impl.ModelImpl
public class ModelImpl
This is the default implementation of the Model.
| Field Summary | |
|---|---|
protected java.util.Map<java.lang.String,BioPAXElement> |
idMap
|
| Constructor Summary | |
|---|---|
protected |
ModelImpl()
|
|
ModelImpl(BioPAXFactory factory)
|
protected |
ModelImpl(BioPAXLevel level)
|
| Method Summary | ||
|---|---|---|
void |
add(BioPAXElement aBioPAXElement)
This method add the given onject to this model. |
|
|
addNew(java.lang.Class<T> c,
java.lang.String id)
This method creates a new object using the model's factory, adds it to the model and returns it. |
|
boolean |
contains(BioPAXElement aBioPAXElement)
This method returns true if given element is the same object ("==") as the object stored in the model usually (for self-consistent models) but not necessarily under the element's ID. |
|
boolean |
containsID(java.lang.String id)
This method checks for the biopax element with the given id, returns true if the object with the given id exists. |
|
BioPAXElement |
getByID(java.lang.String id)
This method returns the biopax element with the given id, returns null if the object with the given id does not exist in this model. |
|
BioPAXLevel |
getLevel()
This method returns the level of the objects that are contained within this model. |
|
java.util.Map<java.lang.String,java.lang.String> |
getNameSpacePrefixMap()
This method returns a map of name space prefixes. |
|
java.util.Set<BioPAXElement> |
getObjects()
This method returns a set of objects in the model. |
|
|
getObjects(java.lang.Class<T> filterBy)
This method returns a set of objects in the model of the given class. |
|
boolean |
isAddDependencies()
When addDependencies is false, the model will not check for the dependent objects of a newly added object. |
|
void |
merge(Model source)
This is default implementation that uses the id-based merging ( SimpleMerger.merge(Model, Model...))
NOTE: some applications, such as those dealing with persistence/transactions
or advanced BioPAX alignment/comparison algorithms (like the Patch),
may have to implement and use a more specific method instead. |
|
void |
remove(BioPAXElement aBioPAXElement)
This method removes the given BioPAX Element from the model. |
|
void |
repair()
This implementation "repairs" the model without unnecessarily copying objects: - recursively adds lost "children" (not null object property values for which Model.contains(BioPAXElement) returns False)
- updates object properties (should refer to model's elements)
- repairs the internal map so that a object returned
by getByID(String) does actually have this ID |
|
void |
replace(BioPAXElement existing,
BioPAXElement replacement)
It does not automatically replace or clean up the old element's object properties, therefore, some child elements may become "dangling" if they were used by the replaced element only. |
|
void |
setAddDependencies(boolean value)
When set to false, the model will not check for the dependent objects of a newly added object. |
|
void |
setFactory(BioPAXFactory factory)
This method sets the factory this model will use for creating BioPAX objects. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.util.Map<java.lang.String,BioPAXElement> idMap
| Constructor Detail |
|---|
protected ModelImpl()
protected ModelImpl(BioPAXLevel level)
public ModelImpl(BioPAXFactory factory)
| Method Detail |
|---|
public boolean containsID(java.lang.String id)
Model
containsID in interface Modelid - of the object to be retrieved.
public BioPAXElement getByID(java.lang.String id)
Model
getByID in interface Modelid - of the object to be retrieved.
public java.util.Map<java.lang.String,java.lang.String> getNameSpacePrefixMap()
Model
getNameSpacePrefixMap in interface Modelpublic void setFactory(BioPAXFactory factory)
ModelModel.addNew(Class, String) method
uses this factory.
setFactory in interface Modelfactory - this model will use for creating
BioPAX objects.public java.util.Set<BioPAXElement> getObjects()
Model
getObjects in interface Modelpublic <T extends BioPAXElement> java.util.Set<T> getObjects(java.lang.Class<T> filterBy)
Model
getObjects in interface ModelfilterBy - class to be used as a filter.
public void remove(BioPAXElement aBioPAXElement)
Model
remove in interface ModelaBioPAXElement - to be removed.
public <T extends BioPAXElement> T addNew(java.lang.Class<T> c,
java.lang.String id)
Model
addNew in interface Modelc - a biopax model interfaceid - of the new object
public boolean contains(BioPAXElement aBioPAXElement)
contains in interface ModelaBioPAXElement -
public void add(BioPAXElement aBioPAXElement)
ModelIllegalBioPAXArgumentException
add in interface ModelaBioPAXElement - to be addedpublic BioPAXLevel getLevel()
Model
getLevel in interface Modelpublic void setAddDependencies(boolean value)
Model
setAddDependencies in interface Modelvalue - defining the dependency adding behaviourpublic boolean isAddDependencies()
Model
isAddDependencies in interface Model
public void replace(BioPAXElement existing,
BioPAXElement replacement)
replace in interface Modelpublic void merge(Model source)
SimpleMerger.merge(Model, Model...))
NOTE: some applications, such as those dealing with persistence/transactions
or advanced BioPAX alignment/comparison algorithms (like the Patch),
may have to implement and use a more specific method instead.
merge in interface Modelsource - a model to mergeSimpleMerger,
Model.merge(Model)public void repair()
Model.contains(BioPAXElement) returns False)
- updates object properties (should refer to model's elements)
- repairs the internal map so that a object returned
by getByID(String) does actually have this ID
repair in interface Model
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||