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 boolean
add(P interactor)
add.boolean
addAll(Collection<? extends P> interactors)
boolean
addAllFeatures(Collection<? extends F> features)
This method will add all features and set the entity of the new features to this current entityboolean
addFeature(F feature)
addFeature.void
clear()
clear.boolean
contains(Object o)
boolean
containsAll(Collection<?> objects)
Collection<Alias>
getAliases()
Collection of aliases which give more information about the participant.Collection<Annotation>
getAnnotations()
Collection of annotations describing the participant.CvTerm
getBiologicalEffect()
The biological effect of the participant in a causal interaction.CvTerm
getBiologicalRole()
The biological role of the participant.Collection<CausalRelationship>
getCausalRelationships()
The causal relationships of this entity on other entities usually part of an interaction.EntityInteractorChangeListener
getChangeListener()
The entity change listener if set, null otherwise.protected AbstractXmlParticipant<I,F>
getDelegate()
Getter for the fielddelegate
.Collection<F>
getFeatures()
Properties for this entity.String
getFullName()
The full name of the entity.int
getId()
getId.I
getInteraction()
The interaction in which the participant is involved.InteractorPool
getInteractor()
The molecule/complex of molecules which interacts.Collection<P>
getJAXBInteractorCandidates()
getJAXBInteractorCandidates.String
getShortName()
The short name of the entity.FileSourceLocator
getSourceLocator()
Getter for the fieldsourceLocator
.Stoichiometry
getStoichiometry()
The stoichiometry for this participant.CvTerm
getType()
Getter for the fieldtype
.Collection<Xref>
getXrefs()
Collection of cross references which give more information about the participant.protected void
initialiseComponentCandidatesSet()
initialiseComponentCandidatesSet.protected void
initialiseComponentCandidatesSetWith(Collection<P> candidates)
initialiseComponentCandidatesSetWith.protected abstract void
initialiseDefaultDelegate()
initialiseDefaultDelegate.boolean
isEmpty()
isEmpty.Iterator<P>
iterator()
iterator.void
onInteractorUpdate(Entity entity, Interactor oldInteractor)
onInteractorUpdateboolean
remove(Object o)
boolean
removeAll(Collection<?> objects)
boolean
removeAllFeatures(Collection<? extends F> features)
This method will remove all the features and set the entity of the removed features to null.boolean
removeFeature(F feature)
removeFeature.boolean
retainAll(Collection<?> objects)
void
setBiologicalEffect(CvTerm biologicalEffect)
Sets the biological effect of the participant in a causal interaction.void
setBiologicalRole(CvTerm bioRole)
Sets the biological role.void
setChangeListener(EntityInteractorChangeListener listener)
Sets the entity change listenervoid
setDelegate(AbstractXmlParticipant<I,F> delegate)
Setter for the fielddelegate
.void
setFullName(String name)
Sets the full name of the entityvoid
setId(int id)
setId.void
setInteraction(I interaction)
Sets the interaction.void
setInteractionAndAddParticipant(I interaction)
Sets the Interaction and add the new Participant to its list of Participants.void
setInteractor(Interactor interactor)
Sets the interactorvoid
setJAXBType(XmlCvTerm type)
Sets the value of the molecule set type property.void
setShortName(String name)
Sets the short name of an entityvoid
setSourceLocator(FileSourceLocator sourceLocator)
Sets the source locatorvoid
setStoichiometry(Integer stoichiometry)
Sets the mean stoichiometry for this participant.void
setStoichiometry(Stoichiometry stoichiometry)
Sets the stoichiometry for this participant.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)int
size()
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
- aAbstractXmlParticipant
object.
-
-
Method Detail
-
initialiseComponentCandidatesSet
protected void initialiseComponentCandidatesSet()
initialiseComponentCandidatesSet.
-
initialiseComponentCandidatesSetWith
protected void initialiseComponentCandidatesSetWith(Collection<P> candidates)
initialiseComponentCandidatesSetWith.
- Parameters:
candidates
- aCollection
object.
-
getInteractor
public InteractorPool getInteractor()
The molecule/complex of molecules which interacts. It cannot be null.- Specified by:
getInteractor
in interfaceEntity<I extends Interaction>
- Returns:
- the interactor
-
setInteractor
public void setInteractor(Interactor interactor)
Sets the interactor- Specified by:
setInteractor
in interfaceEntity<I extends Interaction>
- Parameters:
interactor
- : interactor
-
getType
public CvTerm getType()
Getter for the field
type
.- Specified by:
getType
in interfaceParticipantPool<I extends Interaction,F extends Feature,P extends ParticipantCandidate>
- Returns:
- a
CvTerm
object.
-
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:
setType
in interfaceParticipantPool<I extends Interaction,F extends Feature,P extends ParticipantCandidate>
- Parameters:
type
- : molecule type
-
size
public int size()
size.
- Specified by:
size
in interfaceCollection<I extends Interaction>
- Returns:
- a int.
-
isEmpty
public boolean isEmpty()
isEmpty.
- Specified by:
isEmpty
in interfaceCollection<I extends Interaction>
- Returns:
- a boolean.
-
contains
public boolean contains(Object o)
- Specified by:
contains
in interfaceCollection<I extends Interaction>
-
iterator
public Iterator<P> iterator()
iterator.
- Specified by:
iterator
in interfaceCollection<I extends Interaction>
- Specified by:
iterator
in interfaceIterable<I extends Interaction>
- Returns:
- a
Iterator
object.
-
toArray
public Object[] toArray()
toArray.
- Specified by:
toArray
in interfaceCollection<I extends Interaction>
- Returns:
- an array of
Object
objects.
-
toArray
public <T> T[] toArray(T[] ts)
toArray.
- Specified by:
toArray
in 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:
add
in interfaceCollection<I extends Interaction>
- Parameters:
interactor
- a P object.- Returns:
- a boolean.
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<I extends Interaction>
-
containsAll
public boolean containsAll(Collection<?> objects)
- Specified by:
containsAll
in interfaceCollection<I extends Interaction>
-
addAll
public boolean addAll(Collection<? extends P> interactors)
- Specified by:
addAll
in interfaceCollection<I extends Interaction>
-
retainAll
public boolean retainAll(Collection<?> objects)
- Specified by:
retainAll
in interfaceCollection<I extends Interaction>
-
removeAll
public boolean removeAll(Collection<?> objects)
- Specified by:
removeAll
in interfaceCollection<I extends Interaction>
-
clear
public void clear()
clear.
- Specified by:
clear
in interfaceCollection<I extends Interaction>
-
onInteractorUpdate
public void onInteractorUpdate(Entity entity, Interactor oldInteractor)
onInteractorUpdate
- Specified by:
onInteractorUpdate
in 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
Collection
object.
-
getSourceLocator
public FileSourceLocator getSourceLocator()
Getter for the field
sourceLocator
.- Specified by:
getSourceLocator
in interfaceFileSourceContext
- Returns:
- a
FileSourceLocator
object.
-
setSourceLocator
public void setSourceLocator(FileSourceLocator sourceLocator)
Sets the source locator- Specified by:
setSourceLocator
in interfaceFileSourceContext
- Parameters:
sourceLocator
- : the file locator
-
getId
public int getId()
getId.
- Specified by:
getId
in interfaceExtendedPsiXmlEntity<I extends Interaction>
- Returns:
- a int.
-
setId
public void setId(int id)
setId.
- Specified by:
setId
in 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:
getShortName
in 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:
setShortName
in 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:
getFullName
in 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:
setFullName
in 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:
setInteractionAndAddParticipant
in 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:
getInteraction
in interfaceParticipant<I extends Interaction,F extends Feature>
- Returns:
- the interaction
-
setInteraction
public void setInteraction(I interaction)
Sets the interaction.- Specified by:
setInteraction
in 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:
getBiologicalRole
in 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:
setBiologicalRole
in 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:
getBiologicalEffect
in 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:
setBiologicalEffect
in 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:
getXrefs
in 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:
getAnnotations
in 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:
getAliases
in 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:
getCausalRelationships
in 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:
getFeatures
in 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:
getChangeListener
in interfaceEntity<I extends Interaction>
- Returns:
- the participant change listener
-
setChangeListener
public void setChangeListener(EntityInteractorChangeListener listener)
Sets the entity change listener- Specified by:
setChangeListener
in interfaceEntity<I extends Interaction>
- Parameters:
listener
- : the entity change listener
-
addFeature
public boolean addFeature(F feature)
addFeature.
- Specified by:
addFeature
in interfaceEntity<I extends Interaction>
- Parameters:
feature
- a F object.- Returns:
- a boolean.
-
removeFeature
public boolean removeFeature(F feature)
removeFeature.
- Specified by:
removeFeature
in 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:
addAllFeatures
in 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:
removeAllFeatures
in 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:
getStoichiometry
in interfaceEntity<I extends Interaction>
- Returns:
- the stoichiometry
-
setStoichiometry
public void setStoichiometry(Integer stoichiometry)
Sets the mean stoichiometry for this participant.- Specified by:
setStoichiometry
in interfaceEntity<I extends Interaction>
- Parameters:
stoichiometry
- : mean stoichiometry value
-
setStoichiometry
public void setStoichiometry(Stoichiometry stoichiometry)
Sets the stoichiometry for this participant.- Specified by:
setStoichiometry
in interfaceEntity<I extends Interaction>
- Parameters:
stoichiometry
- : the stoichiometry
-
getDelegate
protected AbstractXmlParticipant<I,F> getDelegate()
Getter for the field
delegate
.- Returns:
- a
AbstractXmlParticipant
object.
-
initialiseDefaultDelegate
protected abstract void initialiseDefaultDelegate()
initialiseDefaultDelegate.
-
setDelegate
public void setDelegate(AbstractXmlParticipant<I,F> delegate)
Setter for the field
delegate
.- Parameters:
delegate
- aAbstractXmlParticipant
object.
-
-