/*******************************/ public TreeNode( Component component_param, ComplexSolrEnricher enricher) { component = component_param ; this.enricher = enricher; if ( component.getInteractor() instanceof InteractionImpl ) { sons = new ArrayList(); for ( Component comp : ((InteractionImpl) component.getInteractor()).getComponents() ) { TreeComponents tree = null ; if ( ! map.containsKey ( comp.getAc() ) ) { tree = new TreeComponents ( comp, enricher ) ; map.put ( comp.getAc(), tree ) ; } else { tree = map.get ( comp.getAc() ) ; } sons.add ( tree ) ; } } else { sons = null ; } }
public int hashCode( boolean includeBinds, boolean includeRanges ) { int result = super.hashCode(); if( includeRanges ) { result = 31 * result + HashCodeUtils.collectionHashCode( ranges ); } result = 31 * result + ( cvFeatureIdentification != null ? cvFeatureIdentification.hashCode() : 0 ); result = 31 * result + ( cvFeatureType != null ? cvFeatureType.hashCode() : 0 ); // hashcode component without including features result = 31 * result + ( component != null ? component.getAc() != null? component.getAc().hashCode() : component.hashCode( false ) : 0 ); // make sure we don't end up in an infinite loop checking on linked features if( includeBinds ) { result = 31 * result + ( binds != null ? binds.hashCode( false, false ) : 0 ); } return result; }
public int hashCode( boolean includeBinds, boolean includeRanges ) { int result = super.hashCode(); if( includeRanges ) { result = 31 * result + HashCodeUtils.collectionHashCode( ranges ); } result = 31 * result + ( cvFeatureIdentification != null ? cvFeatureIdentification.hashCode() : 0 ); result = 31 * result + ( cvFeatureType != null ? cvFeatureType.hashCode() : 0 ); // hashcode component without including features result = 31 * result + ( component != null ? component.getAc() != null? component.getAc().hashCode() : component.hashCode( false ) : 0 ); // make sure we don't end up in an infinite loop checking on linked features if( includeBinds ) { result = 31 * result + ( binds != null ? binds.hashCode( false, false ) : 0 ); } return result; }
@Override @Transactional( "update" ) public void onDeletedComponent(DeletedComponentEvent evt) throws ProcessorException { // reattach the updateProcess to the entity manager ProteinUpdateProcess updateProcess = IntactUpdateContext.getCurrentInstance().getUpdateFactory().getEntityManager().merge(this.updateProcess); Protein protein = evt.getProtein(); String uniprot = evt.getUniprotIdentity(); Collection<uk.ac.ebi.intact.model.Component> deletedComponents = evt.getDeletedComponents(); uk.ac.ebi.intact.update.model.protein.events.DeletedComponentEvent protEvt = new uk.ac.ebi.intact.update.model.protein.events.DeletedComponentEvent(updateProcess, protein, uniprot); for (uk.ac.ebi.intact.model.Component c : deletedComponents){ protEvt.getDeletedComponents().add(c.getAc()); } IntactUpdateContext.getCurrentInstance().getUpdateFactory().getDeletedComponentEventDao().persist(protEvt); }
"(Component: " + component.getAc() + " - " + "Interaction: " + component.getInteraction().getAc() + ")" ); "(Component: " + component.getAc() + " - " + "Interaction: " + component.getInteraction().getAc() + ")" ); "CvBiologicalRole( '" + ( bio == null ? "null" : bio.getShortLabel() ) + "' ). " + "Role was set to default '" + DEFAULT_ROLE + "'. " + "(Component: " + component.getAc() + " - Interaction: " + component.getInteraction().getAc() + ")" ); role = DEFAULT_ROLE;
/** * Retrieves the confidences from a participant, initializing them if necessary. * Do not set the initialized collection of confidences because confidences cannot be orphan * @param component the component * @return The returned confidences are ensured to be initialized * @since 2.4.0 */ public static Collection<ComponentConfidence> ensureInitializedComponentConfidences(Component component) { Collection<ComponentConfidence> confidences; if (IntactCore.isInitialized(component.getConfidences())) { confidences = component.getConfidences(); } else { confidences = IntactContext.getCurrentInstance().getDaoFactory().getComponentConfidenceDao().getByComponentAc(component.getAc()); } return confidences; }
/** * Retrieves the participant detection methods from a participant, initializing them if necessary. * Do not set the initialized collection of participant detection methods because cannot be orphan * @param component the component * @return The returned participant detection methods are ensured to be initialized * @since 2.4.0 */ public static Collection<CvIdentification> ensureInitializedParticipantIdentificationMethods(Component component) { Collection<CvIdentification> partDet; if (IntactCore.isInitialized(component.getParticipantDetectionMethods())) { partDet = component.getParticipantDetectionMethods(); } else { partDet = IntactContext.getCurrentInstance().getDaoFactory().getComponentDao().getParticipantIdentificationMethodsForComponentAc(component.getAc()); } return partDet; }
/** * Retrieves the experimental preparations from a participant, initializing them if necessary. * Do not set the initialized collection of experimental preparations because cannot be orphan * @param component the component * @return The returned experimental preparations are ensured to be initialized * @since 2.4.0 */ public static Collection<CvExperimentalPreparation> ensureInitializedExperimentalPreparations(Component component) { Collection<CvExperimentalPreparation> expPrep; if (IntactCore.isInitialized(component.getExperimentalPreparations())) { expPrep = component.getExperimentalPreparations(); } else { expPrep = IntactContext.getCurrentInstance().getDaoFactory().getComponentDao().getExperimentalPreparationsForComponentAc(component.getAc()); } return expPrep; }
/** * Retrieves the parameters from a participant, initializing them if necessary. * Do not set the initialized collection of parameters because parameters cannot be orphan * @param component the component * @return The returned parameters are ensured to be initialized * @since 2.4.0 */ public static Collection<ComponentParameter> ensureInitializedComponentParameters(Component component) { Collection<ComponentParameter> parameters; if (IntactCore.isInitialized(component.getParameters())) { parameters = component.getParameters(); } else { parameters = IntactContext.getCurrentInstance().getDaoFactory().getComponentParameterDao().getByComponentAc(component.getAc()); } return parameters; }
/** * Retrieves the features from a participant, initializing them if necessary. * Do not set the initialized collection of features because features cannot be orphan * @param component the component * @return The returned features are ensured to be initialized * @since 2.4.0 */ public static Collection<Feature> ensureInitializedFeatures(Component component) { Collection<Feature> features; if (IntactCore.isInitialized(component.getFeatures())) { features = component.getFeatures(); } else { features = IntactContext.getCurrentInstance().getDaoFactory().getFeatureDao().getByComponentAc(component.getAc()); } return features; }
/** * Retrieves the parameters from a participant, initializing them if necessary. * Do not set the initialized collection of parameters because parameters cannot be orphan * @param component the component * @return The returned parameters are ensured to be initialized * @since 2.4.0 */ public static Collection<ComponentParameter> ensureInitializedComponentParameters(Component component) { Collection<ComponentParameter> parameters; if (IntactCore.isInitialized(component.getParameters())) { parameters = component.getParameters(); } else { parameters = IntactContext.getCurrentInstance().getDaoFactory().getComponentParameterDao().getByComponentAc(component.getAc()); } return parameters; }
/** * Retrieves the experimental preparations from a participant, initializing them if necessary. * Do not set the initialized collection of experimental preparations because cannot be orphan * @param component the component * @return The returned experimental preparations are ensured to be initialized * @since 2.4.0 */ public static Collection<CvExperimentalPreparation> ensureInitializedExperimentalPreparations(Component component) { Collection<CvExperimentalPreparation> expPrep; if (IntactCore.isInitialized(component.getExperimentalPreparations())) { expPrep = component.getExperimentalPreparations(); } else { expPrep = IntactContext.getCurrentInstance().getDaoFactory().getComponentDao().getExperimentalPreparationsForComponentAc(component.getAc()); } return expPrep; }
/** * Retrieves the features from a participant, initializing them if necessary. * Do not set the initialized collection of features because features cannot be orphan * @param component the component * @return The returned features are ensured to be initialized * @since 2.4.0 */ public static Collection<Feature> ensureInitializedFeatures(Component component) { Collection<Feature> features; if (IntactCore.isInitialized(component.getFeatures())) { features = component.getFeatures(); } else { features = IntactContext.getCurrentInstance().getDaoFactory().getFeatureDao().getByComponentAc(component.getAc()); } return features; }
/** * Retrieves the experimental roles from a participant, initializing them if necessary. * Do not set the initialized collection of experimental roles because cannot be orphan * @param component the component * @return The returned experimental roles are ensured to be initialized * @since 2.4.0 */ public static Collection<CvExperimentalRole> ensureInitializedExperimentalRoles(Component component) { Collection<CvExperimentalRole> roles; if (IntactCore.isInitialized(component.getExperimentalRoles())) { roles = component.getExperimentalRoles(); } else { roles = IntactContext.getCurrentInstance().getDaoFactory().getComponentDao().getExperimentalRolesForComponentAc(component.getAc()); } return roles; }
/** * Retrieves the participant detection methods from a participant, initializing them if necessary. * Do not set the initialized collection of participant detection methods because cannot be orphan * @param component the component * @return The returned participant detection methods are ensured to be initialized * @since 2.4.0 */ public static Collection<CvIdentification> ensureInitializedParticipantIdentificationMethods(Component component) { Collection<CvIdentification> partDet; if (IntactCore.isInitialized(component.getParticipantDetectionMethods())) { partDet = component.getParticipantDetectionMethods(); } else { partDet = IntactContext.getCurrentInstance().getDaoFactory().getComponentDao().getParticipantIdentificationMethodsForComponentAc(component.getAc()); } return partDet; }
/** * Retrieves the experimental roles from a participant, initializing them if necessary. * Do not set the initialized collection of experimental roles because cannot be orphan * @param component the component * @return The returned experimental roles are ensured to be initialized * @since 2.4.0 */ public static Collection<CvExperimentalRole> ensureInitializedExperimentalRoles(Component component) { Collection<CvExperimentalRole> roles; if (IntactCore.isInitialized(component.getExperimentalRoles())) { roles = component.getExperimentalRoles(); } else { roles = IntactContext.getCurrentInstance().getDaoFactory().getComponentDao().getExperimentalRolesForComponentAc(component.getAc()); } return roles; }
/** * Retrieves the confidences from a participant, initializing them if necessary. * Do not set the initialized collection of confidences because confidences cannot be orphan * @param component the component * @return The returned confidences are ensured to be initialized * @since 2.4.0 */ public static Collection<ComponentConfidence> ensureInitializedComponentConfidences(Component component) { Collection<ComponentConfidence> confidences; if (IntactCore.isInitialized(component.getConfidences())) { confidences = component.getConfidences(); } else { confidences = IntactContext.getCurrentInstance().getDaoFactory().getComponentConfidenceDao().getByComponentAc(component.getAc()); } return confidences; }