|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biopax.paxtools.controller.SimpleMerger
public class SimpleMerger
This is a "simple" BioPAX merger, a utility class to merge 'source' BioPAX models or a set of elements into the target model, using the RDFId (URI) identity only. Merging of normalized, self-consistent models normally gives "better" results (though it depends on the application).
One can also "merge" a model to itself, i.e.: merge(target,target), which adds those missing child elements that were not added (explicitly) to the model (via model.add*) and makes it more integral. Note, "RDFId (URI) identity" means that it skips, i.e., does not copy a source's element to the target (model) nor it updates sources' object properties, if the target already contains the element with the same RDFId. However, after all, it does update (re-wire) all the object properties of just added source elements to make sure they do not refer to the skipped objects (from the "source") anymore (if something is missing, it will be added at this second pass). Note also that this merger does not guarantee the integrity of the passed models: 'target' will be the merged model (often, "more integral"), and the 'source' may be trashed (in fact, - still somewhat usable, but modified for sure, with some of its object properties now refer to target's elements). Finally, although called Simple Merger, it is in fact an advanced BioPAX utility, which should be used wisely. Otherwise, it can actually waste resources. So, consider using model.add(..), model.addNew(..) approach first (or instead), especially, when you're adding "new" things (ID not present in the target model), or/and target model does not contain any references to the source or another one, etc.
| Constructor Summary | |
|---|---|
SimpleMerger(EditorMap map)
|
|
| Method Summary | |
|---|---|
void |
merge(Model target,
BioPAXElement source)
Merges the source element (and its "downstream" dependents) into target model if its RDFId is not yet there. |
void |
merge(Model target,
java.util.Collection<? extends BioPAXElement> elements)
Merges the elements into target model. |
void |
merge(Model target,
Model... sources)
Merges the source models into target model. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleMerger(EditorMap map)
map - a class to editor map for the elements to be modified.| Method Detail |
|---|
public void merge(Model target,
Model... sources)
target - model into which merging process will be donesources - models, if any, that are going to be merged/updated to target
public void merge(Model target,
java.util.Collection<? extends BioPAXElement> elements)
target - model into which merging process will be doneelements - elements, if any, that are going to be merged/updated to target
public void merge(Model target,
BioPAXElement source)
target - source -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||