private <X extends AnnotatedObject> Collection<X> synchronizeCollection( Collection<X> collection ) { if (!IntactCore.isInitializedAndDirty(collection)) { return collection; } Collection<X> synchedCollection = new ArrayList<X>( collection.size() ); for ( X ao : collection ) { synchedCollection.add( synchronize( ao ) ); } return synchedCollection; }
private <X extends AnnotatedObject> Collection<X> synchronizeCollection( Collection<X> collection ) { if (!IntactCore.isInitializedAndDirty(collection)) { return collection; } Collection<X> synchedCollection = new ArrayList<X>( collection.size() ); for ( X ao : collection ) { synchedCollection.add( synchronize( ao ) ); } return synchedCollection; }
private void synchronizeCvObject( CvObject cvObject, boolean synchronizeAnnotatedAttributes ) { if (cvObject instanceof CvDagObject) { CvDagObject cvDagObject = (CvDagObject)cvObject; if (IntactCore.isInitializedAndDirty(cvDagObject.getChildren())){ Collection<CvDagObject> children = synchronizeCollection(cvDagObject.getChildren()); cvDagObject.getChildren().clear(); cvDagObject.getChildren().addAll(children); } if (IntactCore.isInitializedAndDirty(cvDagObject.getParents())){ Collection<CvDagObject> parents = synchronizeCollection(cvDagObject.getParents()); cvDagObject.getParents().clear(); cvDagObject.getParents().addAll(parents); } } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( cvObject ); } }
private void synchronizeCvObject( CvObject cvObject, boolean synchronizeAnnotatedAttributes ) { if (cvObject instanceof CvDagObject) { CvDagObject cvDagObject = (CvDagObject)cvObject; if (IntactCore.isInitializedAndDirty(cvDagObject.getChildren())){ Collection<CvDagObject> children = synchronizeCollection(cvDagObject.getChildren()); cvDagObject.getChildren().clear(); cvDagObject.getChildren().addAll(children); } if (IntactCore.isInitializedAndDirty(cvDagObject.getParents())){ Collection<CvDagObject> parents = synchronizeCollection(cvDagObject.getParents()); cvDagObject.getParents().clear(); cvDagObject.getParents().addAll(parents); } } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( cvObject ); } }
if (IntactCore.isInitializedAndDirty(ao.getXrefs())) { for ( Xref xref : ao.getXrefs() ) { synchedXrefs.add( synchronizeXref( xref, ao ) ); if (IntactCore.isInitializedAndDirty(ao.getAliases())) { for ( Alias alias : ao.getAliases() ) { synchedAliases.add( synchronizeAlias( alias, ao ) ); if (IntactCore.isInitializedAndDirty(ao.getAnnotations())) { for ( Annotation annotation : ao.getAnnotations() ) { synchedAnnotations.add( synchronizeAnnotation( annotation, ao ) );
if (IntactCore.isInitializedAndDirty(ao.getXrefs())) { for ( Xref xref : ao.getXrefs() ) { synchedXrefs.add( synchronizeXref( xref, ao ) ); if (IntactCore.isInitializedAndDirty(ao.getAliases())) { for ( Alias alias : ao.getAliases() ) { synchedAliases.add( synchronizeAlias( alias, ao ) ); if (IntactCore.isInitializedAndDirty(ao.getAnnotations())) { for ( Annotation annotation : ao.getAnnotations() ) { synchedAnnotations.add( synchronizeAnnotation( annotation, ao ) );
private void synchronizePublication( Publication publication, boolean synchronizeAnnotatedAttributes ) { if (IntactCore.isInitializedAndDirty(publication.getExperiments())){ Collection<Experiment> experiments = synchronizeCollection(publication.getExperiments()); publication.getExperiments().clear(); publication.getExperiments().addAll(experiments); } publication.setStatus( synchronize( publication.getStatus() ) ); publication.setCurrentOwner( synchronizeUser(publication.getCurrentOwner()) ); publication.setCurrentReviewer( synchronizeUser(publication.getCurrentReviewer()) ); final List<LifecycleEvent> events = publication.getLifecycleEvents(); if (IntactCore.isInitializedAndDirty( events )){ Collection<LifecycleEvent> synchedEvents = new ArrayList<LifecycleEvent>( events.size() ); for ( LifecycleEvent event : events ) { synchedEvents.add( synchronizeEvent(event) ); } events.clear(); events.addAll( synchedEvents ); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( publication ); } }
private void synchronizePublication( Publication publication, boolean synchronizeAnnotatedAttributes ) { if (IntactCore.isInitializedAndDirty(publication.getExperiments())){ Collection<Experiment> experiments = synchronizeCollection(publication.getExperiments()); publication.getExperiments().clear(); publication.getExperiments().addAll(experiments); } publication.setStatus( synchronize( publication.getStatus() ) ); publication.setCurrentOwner( synchronizeUser(publication.getCurrentOwner()) ); publication.setCurrentReviewer( synchronizeUser(publication.getCurrentReviewer()) ); final List<LifecycleEvent> events = publication.getLifecycleEvents(); if (IntactCore.isInitializedAndDirty( events )){ Collection<LifecycleEvent> synchedEvents = new ArrayList<LifecycleEvent>( events.size() ); for ( LifecycleEvent event : events ) { synchedEvents.add( synchronizeEvent(event) ); } events.clear(); events.addAll( synchedEvents ); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( publication ); } }
if (IntactCore.isInitializedAndDirty( roles )){ Collection<Role> synchedRoles = new ArrayList<Role>( roles.size() ); for ( Role role : roles ) { if (IntactCore.isInitializedAndDirty( prefs )){ Collection<Preference> synchedPrefs = new ArrayList<Preference>( prefs.size() ); for ( Preference p : prefs ) {
if (IntactCore.isInitializedAndDirty( roles )){ Collection<Role> synchedRoles = new ArrayList<Role>( roles.size() ); for ( Role role : roles ) { if (IntactCore.isInitializedAndDirty( prefs )){ Collection<Preference> synchedPrefs = new ArrayList<Preference>( prefs.size() ); for ( Preference p : prefs ) {
private void synchronizeInteraction( Interaction interaction, boolean synchronizeAnnotatedAttributes ) { interaction.setCvInteractionType( synchronize( interaction.getCvInteractionType() ) ); interaction.setCvInteractorType( synchronize( interaction.getCvInteractorType() ) ); if (IntactCore.isInitializedAndDirty(interaction.getComponents())){ Collection<Component> components = synchronizeCollection(interaction.getComponents()); interaction.getComponents().clear(); interaction.getComponents().addAll(components); } interaction.setBioSource( synchronize( interaction.getBioSource() ) ); if (IntactCore.isInitializedAndDirty(interaction.getExperiments())){ Collection<Experiment> experiment = synchronizeCollection(interaction.getExperiments()); interaction.getExperiments().clear(); interaction.getExperiments().addAll(experiment); } // cannot call setConfidences in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(interaction.getConfidences())){ Collection<Confidence> confidences = synchronizeConfidences(interaction.getConfidences(), interaction); interaction.getConfidences().clear(); interaction.getConfidences().addAll(confidences); } // cannot call setParameters in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(interaction.getParameters())){ Collection<InteractionParameter> interactionParameters = synchronizeInteractionParameters(interaction.getParameters(), interaction); interaction.getParameters().clear(); interaction.getParameters().addAll(interactionParameters); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( interaction ); } }
private void synchronizeInteractor( Interactor interactor, boolean synchronizeAnnotatedAtributes ) { if (IntactCore.isInitializedAndDirty(interactor.getActiveInstances())){ Collection<Component> activeInstances = synchronizeCollection(interactor.getActiveInstances()); interactor.getActiveInstances().clear(); interactor.getActiveInstances().addAll(activeInstances); } interactor.setBioSource( synchronize( interactor.getBioSource() ) ); interactor.setCvInteractorType( synchronize( interactor.getCvInteractorType() ) ); if (synchronizeAnnotatedAtributes){ synchronizeAnnotatedObjectCommons( interactor ); } }
private void synchronizeInteractor( Interactor interactor, boolean synchronizeAnnotatedAtributes ) { if (IntactCore.isInitializedAndDirty(interactor.getActiveInstances())){ Collection<Component> activeInstances = synchronizeCollection(interactor.getActiveInstances()); interactor.getActiveInstances().clear(); interactor.getActiveInstances().addAll(activeInstances); } interactor.setBioSource( synchronize( interactor.getBioSource() ) ); interactor.setCvInteractorType( synchronize( interactor.getCvInteractorType() ) ); if (synchronizeAnnotatedAtributes){ synchronizeAnnotatedObjectCommons( interactor ); } }
private void synchronizeInteraction( Interaction interaction, boolean synchronizeAnnotatedAttributes ) { interaction.setCvInteractionType( synchronize( interaction.getCvInteractionType() ) ); interaction.setCvInteractorType( synchronize( interaction.getCvInteractorType() ) ); if (IntactCore.isInitializedAndDirty(interaction.getComponents())){ Collection<Component> components = synchronizeCollection(interaction.getComponents()); interaction.getComponents().clear(); interaction.getComponents().addAll(components); } interaction.setBioSource( synchronize( interaction.getBioSource() ) ); if (IntactCore.isInitializedAndDirty(interaction.getExperiments())){ Collection<Experiment> experiment = synchronizeCollection(interaction.getExperiments()); interaction.getExperiments().clear(); interaction.getExperiments().addAll(experiment); } // cannot call setConfidences in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(interaction.getConfidences())){ Collection<Confidence> confidences = synchronizeConfidences(interaction.getConfidences(), interaction); interaction.getConfidences().clear(); interaction.getConfidences().addAll(confidences); } // cannot call setParameters in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(interaction.getParameters())){ Collection<InteractionParameter> interactionParameters = synchronizeInteractionParameters(interaction.getParameters(), interaction); interaction.getParameters().clear(); interaction.getParameters().addAll(interactionParameters); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( interaction ); } }
private void synchronizeComponent( Component component, boolean synchronizeAnnotatedAttributes ) { if (IntactCore.isInitializedAndDirty(component.getFeatures())) { Collection<Feature> features = synchronizeCollection(component.getFeatures()); component.getFeatures().clear(); if (IntactCore.isInitializedAndDirty(component.getExperimentalRoles())) { Collection<CvExperimentalRole> roles = synchronizeCollection( component.getExperimentalRoles() ); component.getExperimentalRoles().clear(); component.setInteractor( synchronize( component.getInteractor() ) ); if (IntactCore.isInitializedAndDirty(component.getParticipantDetectionMethods())) { Collection<CvIdentification> partDet = synchronizeCollection( component.getParticipantDetectionMethods()); component.getParticipantDetectionMethods().clear(); if (IntactCore.isInitializedAndDirty(component.getExperimentalPreparations())) { Collection<CvExperimentalPreparation> expPrep = synchronizeCollection( component.getExperimentalPreparations() ); component.getExperimentalPreparations().clear(); if (IntactCore.isInitializedAndDirty(component.getParameters())) { Collection<ComponentParameter> componentParameters = synchronizeComponentParameters(component.getParameters(), component); component.getParameters().clear(); if (IntactCore.isInitializedAndDirty(component.getConfidences())) { Collection<ComponentConfidence> componentConfidences = synchronizeComponentConfidences(component.getConfidences(), component); component.getConfidences().clear();
private void synchronizeComponent( Component component, boolean synchronizeAnnotatedAttributes ) { if (IntactCore.isInitializedAndDirty(component.getFeatures())) { Collection<Feature> features = synchronizeCollection(component.getFeatures()); component.getFeatures().clear(); if (IntactCore.isInitializedAndDirty(component.getExperimentalRoles())) { Collection<CvExperimentalRole> roles = synchronizeCollection( component.getExperimentalRoles() ); component.getExperimentalRoles().clear(); component.setInteractor( synchronize( component.getInteractor() ) ); if (IntactCore.isInitializedAndDirty(component.getParticipantDetectionMethods())) { Collection<CvIdentification> partDet = synchronizeCollection( component.getParticipantDetectionMethods()); component.getParticipantDetectionMethods().clear(); if (IntactCore.isInitializedAndDirty(component.getExperimentalPreparations())) { Collection<CvExperimentalPreparation> expPrep = synchronizeCollection( component.getExperimentalPreparations() ); component.getExperimentalPreparations().clear(); if (IntactCore.isInitializedAndDirty(component.getParameters())) { Collection<ComponentParameter> componentParameters = synchronizeComponentParameters(component.getParameters(), component); component.getParameters().clear(); if (IntactCore.isInitializedAndDirty(component.getConfidences())) { Collection<ComponentConfidence> componentConfidences = synchronizeComponentConfidences(component.getConfidences(), component); component.getConfidences().clear();
private void synchronizeFeature( Feature feature, boolean synchronizeAnnotatedAttributes ) { feature.setBoundDomain( synchronize( feature.getBoundDomain() ) ); feature.setComponent( synchronize( feature.getComponent() ) ); feature.setCvFeatureIdentification( synchronize( feature.getCvFeatureIdentification() ) ); feature.setCvFeatureType( synchronize( feature.getCvFeatureType() ) ); // cannot call setRanges in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(feature.getRanges())){ Collection<Range> ranges = synchronizeRanges(feature.getRanges(), feature); feature.getRanges().clear(); feature.getRanges().addAll(ranges); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( feature ); } }
private void synchronizeExperiment( Experiment experiment, boolean synchronizeAnnotatedAttributes ) { experiment.setPublication( synchronize( experiment.getPublication() ) ); if (IntactCore.isInitializedAndDirty(experiment.getInteractions())){ Collection<Interaction> interactions = synchronizeCollection(experiment.getInteractions()); experiment.getInteractions().clear(); experiment.getInteractions().addAll(interactions); } experiment.setCvIdentification(synchronize(experiment.getCvIdentification())); experiment.setCvInteraction( synchronize( experiment.getCvInteraction() ) ); experiment.setBioSource( synchronize( experiment.getBioSource() ) ); if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( experiment ); } }
private void synchronizeExperiment( Experiment experiment, boolean synchronizeAnnotatedAttributes ) { experiment.setPublication( synchronize( experiment.getPublication() ) ); if (IntactCore.isInitializedAndDirty(experiment.getInteractions())){ Collection<Interaction> interactions = synchronizeCollection(experiment.getInteractions()); experiment.getInteractions().clear(); experiment.getInteractions().addAll(interactions); } experiment.setCvIdentification(synchronize(experiment.getCvIdentification())); experiment.setCvInteraction( synchronize( experiment.getCvInteraction() ) ); experiment.setBioSource( synchronize( experiment.getBioSource() ) ); if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( experiment ); } }
private void synchronizeFeature( Feature feature, boolean synchronizeAnnotatedAttributes ) { feature.setBoundDomain( synchronize( feature.getBoundDomain() ) ); feature.setComponent( synchronize( feature.getComponent() ) ); feature.setCvFeatureIdentification( synchronize( feature.getCvFeatureIdentification() ) ); feature.setCvFeatureType( synchronize( feature.getCvFeatureType() ) ); // cannot call setRanges in interaction because of orphan relationship limitation if (IntactCore.isInitializedAndDirty(feature.getRanges())){ Collection<Range> ranges = synchronizeRanges(feature.getRanges(), feature); feature.getRanges().clear(); feature.getRanges().addAll(ranges); } if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( feature ); } }