Class AbstractXmlParticipantPool<I extends Interaction,F extends Feature,P extends ParticipantCandidate>
- java.lang.Object
-
- psidev.psi.mi.jami.xml.model.extension.xml254.AbstractXmlParticipantPool<I,F,P>
-
- All Implemented Interfaces:
Iterable<P>,Collection<P>,EventListener,FileSourceContext,EntityInteractorChangeListener,Entity<F>,NamedParticipant<I,F>,Participant<I,F>,ParticipantPool<I,F,P>,ExtendedPsiXmlEntity<F>
- Direct Known Subclasses:
XmlExperimentalParticipantPool,XmlModelledParticipantPool
public abstract class AbstractXmlParticipantPool<I extends Interaction,F extends Feature,P extends ParticipantCandidate> extends Object implements ParticipantPool<I,F,P>, EntityInteractorChangeListener, FileSourceContext, ExtendedPsiXmlEntity<F>, NamedParticipant<I,F>
Abstract class for XML Participant pool- Since:
09/07/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Field Summary
-
Fields inherited from interface psidev.psi.mi.jami.model.Participant
ACCEPTOR_ROLE, ACCEPTOR_ROLE_MI, BAIT_ROLE, BAIT_ROLE_MI, DONOR_ROLE, DONOR_ROLE_MI, ELECTRON_ACCEPTOR_ROLE, ELECTRON_ACCEPTOR_ROLE_MI, ELECTRON_DONOR_ROLE, ELECTRON_DONOR_ROLE_MI, ENZYME_REGULATOR_ROLE, ENZYME_REGULATOR_ROLE_MI, ENZYME_ROLE, ENZYME_ROLE_MI, ENZYME_TARGET_ROLE, ENZYME_TARGET_ROLE_MI, FLUORESCENCE_ACCEPTOR_ROLE, FLUORESCENCE_ACCEPTOR_ROLE_MI, FLUORESCENCE_DONOR_ROLE, FLUORESCENCE_DONOR_ROLE_MI, INHIBITED, INHIBITED_MI, INHIBITOR, INHIBITOR_MI, NEUTRAL, NEUTRAL_MI, PHOSPHATE_ACCEPTOR_ROLE, PHOSPHATE_ACCEPTOR_ROLE_MI, PHOSPHATE_DONOR_ROLE, PHOSPHATE_DONOR_ROLE_MI, PHOTON_ACCEPTOR_ROLE, PHOTON_ACCEPTOR_ROLE_MI, PHOTON_DONOR_ROLE, PHOTON_DONOR_ROLE_MI, PREDETERMINED, PREDETERMINED_MI, PREY, PREY_MI, PUTATIVE_SELF_ROLE, PUTATIVE_SELF_ROLE_MI, SELF_ROLE, SELF_ROLE_MI, SUPPRESSED_GENE_ROLE, SUPPRESSED_GENE_ROLE_MI, SUPPRESSOR_GENE_ROLE, SUPPRESSOR_GENE_ROLE_MI, UNSPECIFIED_ROLE, UNSPECIFIED_ROLE_MI
-
-
Constructor Summary
Constructors Constructor Description AbstractXmlParticipantPool()Constructor for AbstractXmlParticipantPool.AbstractXmlParticipantPool(AbstractXmlParticipant<I,F> delegate)Constructor for AbstractXmlParticipantPool.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanadd(P interactor)add.booleanaddAll(Collection<? extends P> interactors)booleanaddAllFeatures(Collection<? extends F> features)This method will add all features and set the entity of the new features to this current entitybooleanaddFeature(F feature)addFeature.voidclear()clear.booleancontains(Object o)booleancontainsAll(Collection<?> objects)Collection<Alias>getAliases()Collection of aliases which give more information about the participant.Collection<Annotation>getAnnotations()Collection of annotations describing the participant.CvTermgetBiologicalEffect()The biological effect of the participant in a causal interaction.CvTermgetBiologicalRole()The biological role of the participant.Collection<CausalRelationship>getCausalRelationships()The causal relationships of this entity on other entities usually part of an interaction.EntityInteractorChangeListenergetChangeListener()The entity change listener if set, null otherwise.protected AbstractXmlParticipant<I,F>getDelegate()Getter for the fielddelegate.Collection<F>getFeatures()Properties for this entity.StringgetFullName()The full name of the entity.intgetId()getId.IgetInteraction()The interaction in which the participant is involved.InteractorPoolgetInteractor()The molecule/complex of molecules which interacts.Collection<P>getJAXBInteractorCandidates()getJAXBInteractorCandidates.StringgetShortName()The short name of the entity.FileSourceLocatorgetSourceLocator()Getter for the fieldsourceLocator.StoichiometrygetStoichiometry()The stoichiometry for this participant.CvTermgetType()Getter for the fieldtype.Collection<Xref>getXrefs()Collection of cross references which give more information about the participant.protected voidinitialiseComponentCandidatesSet()initialiseComponentCandidatesSet.protected voidinitialiseComponentCandidatesSetWith(Collection<P> candidates)initialiseComponentCandidatesSetWith.protected abstract voidinitialiseDefaultDelegate()initialiseDefaultDelegate.booleanisEmpty()isEmpty.Iterator<P>iterator()iterator.voidonInteractorUpdate(Entity entity, Interactor oldInteractor)onInteractorUpdatebooleanremove(Object o)booleanremoveAll(Collection<?> objects)booleanremoveAllFeatures(Collection<? extends F> features)This method will remove all the features and set the entity of the removed features to null.booleanremoveFeature(F feature)removeFeature.booleanretainAll(Collection<?> objects)voidsetBiologicalEffect(CvTerm biologicalEffect)Sets the biological effect of the participant in a causal interaction.voidsetBiologicalRole(CvTerm bioRole)Sets the biological role.voidsetChangeListener(EntityInteractorChangeListener listener)Sets the entity change listenervoidsetDelegate(AbstractXmlParticipant<I,F> delegate)Setter for the fielddelegate.voidsetFullName(String name)Sets the full name of the entityvoidsetId(int id)setId.voidsetInteraction(I interaction)Sets the interaction.voidsetInteractionAndAddParticipant(I interaction)Sets the Interaction and add the new Participant to its list of Participants.voidsetInteractor(Interactor interactor)Sets the interactorvoidsetJAXBType(XmlCvTerm type)Sets the value of the molecule set type property.voidsetShortName(String name)Sets the short name of an entityvoidsetSourceLocator(FileSourceLocator sourceLocator)Sets the source locatorvoidsetStoichiometry(Integer stoichiometry)Sets the mean stoichiometry for this participant.voidsetStoichiometry(Stoichiometry stoichiometry)Sets the stoichiometry for this participant.voidsetType(CvTerm type)Sets the pool type for this participant pool If the given type is null, this method automatically sets the interactor type to 'molecule set' (MI:1304)intsize()size.Object[]toArray()toArray.<T> T[]toArray(T[] ts)toArray.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Methods inherited from interface psidev.psi.mi.jami.datasource.FileSourceContext
toString
-
-
-
-
Constructor Detail
-
AbstractXmlParticipantPool
public AbstractXmlParticipantPool()
Constructor for AbstractXmlParticipantPool.
-
AbstractXmlParticipantPool
public AbstractXmlParticipantPool(AbstractXmlParticipant<I,F> delegate)
Constructor for AbstractXmlParticipantPool.
- Parameters:
delegate- aAbstractXmlParticipantobject.
-
-
Method Detail
-
initialiseComponentCandidatesSet
protected void initialiseComponentCandidatesSet()
initialiseComponentCandidatesSet.
-
initialiseComponentCandidatesSetWith
protected void initialiseComponentCandidatesSetWith(Collection<P> candidates)
initialiseComponentCandidatesSetWith.
- Parameters:
candidates- aCollectionobject.
-
getInteractor
public InteractorPool getInteractor()
The molecule/complex of molecules which interacts. It cannot be null.- Specified by:
getInteractorin interfaceEntity<I extends Interaction>- Returns:
- the interactor
-
setInteractor
public void setInteractor(Interactor interactor)
Sets the interactor- Specified by:
setInteractorin interfaceEntity<I extends Interaction>- Parameters:
interactor- : interactor
-
getType
public CvTerm getType()
Getter for the field
type.- Specified by:
getTypein interfaceParticipantPool<I extends Interaction,F extends Feature,P extends ParticipantCandidate>- Returns:
- a
CvTermobject.
-
setType
public void setType(CvTerm type)
Sets the pool type for this participant pool If the given type is null, this method automatically sets the interactor type to 'molecule set' (MI:1304) Sets the component set type. Sets the type to molecule set (MI:1304) if the given type is null- Specified by:
setTypein interfaceParticipantPool<I extends Interaction,F extends Feature,P extends ParticipantCandidate>- Parameters:
type- : molecule type
-
size
public int size()
size.
- Specified by:
sizein interfaceCollection<I extends Interaction>- Returns:
- a int.
-
isEmpty
public boolean isEmpty()
isEmpty.
- Specified by:
isEmptyin interfaceCollection<I extends Interaction>- Returns:
- a boolean.
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<I extends Interaction>
-
iterator
public Iterator<P> iterator()
iterator.
- Specified by:
iteratorin interfaceCollection<I extends Interaction>- Specified by:
iteratorin interfaceIterable<I extends Interaction>- Returns:
- a
Iteratorobject.
-
toArray
public Object[] toArray()
toArray.
- Specified by:
toArrayin interfaceCollection<I extends Interaction>- Returns:
- an array of
Objectobjects.
-
toArray
public <T> T[] toArray(T[] ts)
toArray.
- Specified by:
toArrayin interfaceCollection<I extends Interaction>- Type Parameters:
T- a T object.- Parameters:
ts- an array of T objects.- Returns:
- an array of T objects.
-
add
public boolean add(P interactor)
add.
- Specified by:
addin interfaceCollection<I extends Interaction>- Parameters:
interactor- a P object.- Returns:
- a boolean.
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<I extends Interaction>
-
containsAll
public boolean containsAll(Collection<?> objects)
- Specified by:
containsAllin interfaceCollection<I extends Interaction>
-
addAll
public boolean addAll(Collection<? extends P> interactors)
- Specified by:
addAllin interfaceCollection<I extends Interaction>
-
retainAll
public boolean retainAll(Collection<?> objects)
- Specified by:
retainAllin interfaceCollection<I extends Interaction>
-
removeAll
public boolean removeAll(Collection<?> objects)
- Specified by:
removeAllin interfaceCollection<I extends Interaction>
-
clear
public void clear()
clear.
- Specified by:
clearin interfaceCollection<I extends Interaction>
-
onInteractorUpdate
public void onInteractorUpdate(Entity entity, Interactor oldInteractor)
onInteractorUpdate
- Specified by:
onInteractorUpdatein interfaceEntityInteractorChangeListener- Parameters:
entity- : updated entityoldInteractor- : old interactor
-
setJAXBType
public void setJAXBType(XmlCvTerm type)
Sets the value of the molecule set type property.- Parameters:
type- allowed object isXmlCvTerm
-
getJAXBInteractorCandidates
public Collection<P> getJAXBInteractorCandidates()
getJAXBInteractorCandidates.
- Returns:
- a
Collectionobject.
-
getSourceLocator
public FileSourceLocator getSourceLocator()
Getter for the field
sourceLocator.- Specified by:
getSourceLocatorin interfaceFileSourceContext- Returns:
- a
FileSourceLocatorobject.
-
setSourceLocator
public void setSourceLocator(FileSourceLocator sourceLocator)
Sets the source locator- Specified by:
setSourceLocatorin interfaceFileSourceContext- Parameters:
sourceLocator- : the file locator
-
getId
public int getId()
getId.
- Specified by:
getIdin interfaceExtendedPsiXmlEntity<I extends Interaction>- Returns:
- a int.
-
setId
public void setId(int id)
setId.
- Specified by:
setIdin interfaceExtendedPsiXmlEntity<I extends Interaction>- Parameters:
id- a int.
-
getShortName
public String getShortName()
The short name of the entity. It can be null or empty.- Specified by:
getShortNamein interfaceNamedParticipant<I extends Interaction,F extends Feature>- Returns:
- the short name
-
setShortName
public void setShortName(String name)
Sets the short name of an entity- Specified by:
setShortNamein interfaceNamedParticipant<I extends Interaction,F extends Feature>- Parameters:
name- : short name
-
getFullName
public String getFullName()
The full name of the entity. It can be null- Specified by:
getFullNamein interfaceNamedParticipant<I extends Interaction,F extends Feature>- Returns:
- the full name
-
setFullName
public void setFullName(String name)
Sets the full name of the entity- Specified by:
setFullNamein interfaceNamedParticipant<I extends Interaction,F extends Feature>- Parameters:
name- : full name
-
setInteractionAndAddParticipant
public void setInteractionAndAddParticipant(I interaction)
Sets the Interaction and add the new Participant to its list of Participants. If the given interaction is null, it will remove the Participant from the previous interaction it was attached to- Specified by:
setInteractionAndAddParticipantin interfaceParticipant<I extends Interaction,F extends Feature>- Parameters:
interaction- : interaction
-
getInteraction
public I getInteraction()
The interaction in which the participant is involved. It can be null if the participant is not attached to any interactions. It can happen if the participant has been removed from an interaction and is now invalid.- Specified by:
getInteractionin interfaceParticipant<I extends Interaction,F extends Feature>- Returns:
- the interaction
-
setInteraction
public void setInteraction(I interaction)
Sets the interaction.- Specified by:
setInteractionin interfaceParticipant<I extends Interaction,F extends Feature>- Parameters:
interaction- : interaction
-
getBiologicalRole
public CvTerm getBiologicalRole()
The biological role of the participant. It is a controlled vocabulary term and cannot be null. It the biological role of a participant is not known or not relevant, the method should return unspecified role (MI:0499) Ex: enzyme, enzyme target, ...- Specified by:
getBiologicalRolein interfaceParticipant<I extends Interaction,F extends Feature>- Returns:
- the biological role
-
setBiologicalRole
public void setBiologicalRole(CvTerm bioRole)
Sets the biological role. If the bioRole is null, should create a bioRole- Specified by:
setBiologicalRolein interfaceParticipant<I extends Interaction,F extends Feature>- Parameters:
bioRole- : biological role unspecified role (MI:0499)
-
getBiologicalEffect
public CvTerm getBiologicalEffect()
The biological effect of the participant in a causal interaction. It is a controlled vocabulary term and can be null.- Specified by:
getBiologicalEffectin interfaceParticipant<I extends Interaction,F extends Feature>- Returns:
- the biological effect
-
setBiologicalEffect
public void setBiologicalEffect(CvTerm biologicalEffect)
Sets the biological effect of the participant in a causal interaction.- Specified by:
setBiologicalEffectin interfaceParticipant<I extends Interaction,F extends Feature>- Parameters:
biologicalEffect- : biological effect
-
getXrefs
public Collection<Xref> getXrefs()
Collection of cross references which give more information about the participant. The set of xrefs cannot be null. If the participant does not have any xrefs, the method should return an empty Collection. Ex: author identifiers, ...- Specified by:
getXrefsin interfaceParticipant<I extends Interaction,F extends Feature>- Returns:
- the xrefs
-
getAnnotations
public Collection<Annotation> getAnnotations()
Collection of annotations describing the participant. The set cannot be null. If the participant does not have any annotations, the method should return an empty Collection.- Specified by:
getAnnotationsin interfaceParticipant<I extends Interaction,F extends Feature>- Returns:
- the annotations
-
getAliases
public Collection<Alias> getAliases()
Collection of aliases which give more information about the participant. The set of aliases cannot be null. If the participant does not have any aliases, the method should return an empty Collection. Ex: author assigned name, ...- Specified by:
getAliasesin interfaceParticipant<I extends Interaction,F extends Feature>- Returns:
- the xrefs
-
getCausalRelationships
public Collection<CausalRelationship> getCausalRelationships()
The causal relationships of this entity on other entities usually part of an interaction. The set of causal relationship cannot be null. If the entity does not have any causal relationship, the method should return an empty Collection. Ex: increasing, decreasing, disrupting, etc.- Specified by:
getCausalRelationshipsin interfaceEntity<I extends Interaction>- Returns:
- the collection of causal relationships attached to this entity
-
getFeatures
public Collection<F> getFeatures()
Properties for this entity. The collection cannot be null. If the entity does not have any features, the method should return an empty collection.- Specified by:
getFeaturesin interfaceEntity<I extends Interaction>- Returns:
- the features
-
getChangeListener
public EntityInteractorChangeListener getChangeListener()
The entity change listener if set, null otherwise. The entity change listener listen to changes in entity (interactor changes)- Specified by:
getChangeListenerin interfaceEntity<I extends Interaction>- Returns:
- the participant change listener
-
setChangeListener
public void setChangeListener(EntityInteractorChangeListener listener)
Sets the entity change listener- Specified by:
setChangeListenerin interfaceEntity<I extends Interaction>- Parameters:
listener- : the entity change listener
-
addFeature
public boolean addFeature(F feature)
addFeature.
- Specified by:
addFeaturein interfaceEntity<I extends Interaction>- Parameters:
feature- a F object.- Returns:
- a boolean.
-
removeFeature
public boolean removeFeature(F feature)
removeFeature.
- Specified by:
removeFeaturein interfaceEntity<I extends Interaction>- Parameters:
feature- a F object.- Returns:
- a boolean.
-
addAllFeatures
public boolean addAllFeatures(Collection<? extends F> features)
This method will add all features and set the entity of the new features to this current entity- Specified by:
addAllFeaturesin interfaceEntity<I extends Interaction>- Parameters:
features- : features to add- Returns:
- true if features are added to the list of features
-
removeAllFeatures
public boolean removeAllFeatures(Collection<? extends F> features)
This method will remove all the features and set the entity of the removed features to null.- Specified by:
removeAllFeaturesin interfaceEntity<I extends Interaction>- Parameters:
features- : features to remove- Returns:
- true if features are removed from the list of features
-
getStoichiometry
public Stoichiometry getStoichiometry()
The stoichiometry for this participant. If the stoichiometry for this participant is unknown, the method should return null.- Specified by:
getStoichiometryin interfaceEntity<I extends Interaction>- Returns:
- the stoichiometry
-
setStoichiometry
public void setStoichiometry(Integer stoichiometry)
Sets the mean stoichiometry for this participant.- Specified by:
setStoichiometryin interfaceEntity<I extends Interaction>- Parameters:
stoichiometry- : mean stoichiometry value
-
setStoichiometry
public void setStoichiometry(Stoichiometry stoichiometry)
Sets the stoichiometry for this participant.- Specified by:
setStoichiometryin interfaceEntity<I extends Interaction>- Parameters:
stoichiometry- : the stoichiometry
-
getDelegate
protected AbstractXmlParticipant<I,F> getDelegate()
Getter for the field
delegate.- Returns:
- a
AbstractXmlParticipantobject.
-
initialiseDefaultDelegate
protected abstract void initialiseDefaultDelegate()
initialiseDefaultDelegate.
-
setDelegate
public void setDelegate(AbstractXmlParticipant<I,F> delegate)
Setter for the field
delegate.- Parameters:
delegate- aAbstractXmlParticipantobject.
-
-