org.biopax.paxtools.model
Interface Model

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
ModelImpl

public interface Model
extends java.io.Serializable

A model acts as a container for BioPAX elements. Every object within a mode must have unique id. A single object can be contained in multiple models.


Method Summary
 void add(BioPAXElement aBioPAXElement)
          This method add the given onject to this model.
<T extends BioPAXElement>
T
addNew(java.lang.Class<T> aClass, 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 the parameter is contained within this model.
 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.
<T extends BioPAXElement>
java.util.Set<T>
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)
          Merges the source model into this one.
 void remove(BioPAXElement aBioPAXElement)
          This method removes the given BioPAX Element from the model.
 void repair()
          Attempts to repair the model, i.e., make it self-consistent, integral.
 void replace(BioPAXElement existing, BioPAXElement replacement)
          Replaces existing BioPAX element with another one, of the same or possibly equivalent type, and updates all the affected references to it (object properties).
 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.
 

Method Detail

add

void add(BioPAXElement aBioPAXElement)
This method add the given onject to this model. If the object points to other objects that are not in the model, it is user's responsibility to add them into the model as well. If an object with the same id already exists, it will throw an IllegalBioPAXArgumentException

Parameters:
aBioPAXElement - to be added

addNew

<T extends BioPAXElement> T addNew(java.lang.Class<T> aClass,
                                   java.lang.String id)
This method creates a new object using the model's factory, adds it to the model and returns it.

Parameters:
aClass - a biopax model interface
id - of the new object
Returns:
newly created object

contains

boolean contains(BioPAXElement aBioPAXElement)
This method returns true if the parameter is contained within this model.

Parameters:
aBioPAXElement - to be checked
Returns:
true if the parameter is in the object set

getByID

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.

Parameters:
id - of the object to be retrieved.
Returns:
biopax element with the given id.

containsID

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. in this model.

Parameters:
id - of the object to be retrieved.
Returns:
biopax element with the given id.

getNameSpacePrefixMap

java.util.Map<java.lang.String,java.lang.String> getNameSpacePrefixMap()
This method returns a map of name space prefixes. This map can be modified.

Returns:
a map, mapping prefixes to full namespaces.

getObjects

java.util.Set<BioPAXElement> getObjects()
This method returns a set of objects in the model. Contents of this set can not be modified.

Returns:
an unmodifiable set of objects.

getObjects

<T extends BioPAXElement> java.util.Set<T> getObjects(java.lang.Class<T> filterBy)
This method returns a set of objects in the model of the given class. Contents of this set should not be modified.

Parameters:
filterBy - class to be used as a filter.
Returns:
an unmodifiable set of objects of the given class.

remove

void remove(BioPAXElement aBioPAXElement)
This method removes the given BioPAX Element from the model. Other objects in the model can still point to this object. It is user's responsibility to properly excise these properties.

Parameters:
aBioPAXElement - to be removed.

setFactory

void setFactory(BioPAXFactory factory)
This method sets the factory this model will use for creating BioPAX objects. For example addNew(Class, String) method uses this factory.

Parameters:
factory - this model will use for creating BioPAX objects.

getLevel

BioPAXLevel getLevel()
This method returns the level of the objects that are contained within this model.

Returns:
level of the objects within this model.

setAddDependencies

void setAddDependencies(boolean value)
When set to false, the model will not check for the dependent objects of a newly added object. When true it will traverse and add all dependent objects that are not already in the model. This feature is currently experimental.

Parameters:
value - defining the dependency adding behaviour

isAddDependencies

boolean isAddDependencies()
When addDependencies is false, the model will not check for the dependent objects of a newly added object. When true it will traverse and add all dependent objects that are not already in the model. This feature is currently experimental.

Returns:
whether adding dependencies.

merge

void merge(Model source)
Merges the source model into this one.

Parameters:
source - a model to merge

replace

void replace(BioPAXElement existing,
             BioPAXElement replacement)
Replaces existing BioPAX element with another one, of the same or possibly equivalent type, and updates all the affected references to it (object properties).

Parameters:
existing -
replacement -

repair

void repair()
Attempts to repair the model, i.e., make it self-consistent, integral.



Copyright © 2011 BioPAX. All Rights Reserved.