Package psidev.psi.mi.jami.utils.clone
Class InteractionCloner
- java.lang.Object
-
- psidev.psi.mi.jami.utils.clone.InteractionCloner
-
public class InteractionCloner extends Object
Utility class to clone and copy interaction properties- Since:
13/02/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description InteractionCloner()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
copyAndOverrideBasicInteractionProperties(Interaction source, Interaction target, boolean createNewParticipant, boolean ignoreParticipants)
This method will copy basic properties of interaction source in interaction target and will override all the other properties of Target interaction.static void
copyAndOverrideBasicParticipantsToBinary(Interaction source, BinaryInteraction target, boolean createNewParticipant, boolean self)
This method will copy participants of interaction source in binary target.static void
copyAndOverrideInteractionEvidenceProperties(InteractionEvidence source, InteractionEvidence target, boolean createNewParticipant, boolean ignoreParticipants)
This method will copy properties of interaction source in interaction target and will override all the other properties of Target interaction.static void
copyAndOverrideModelledInteractionProperties(ModelledInteraction source, ModelledInteraction target, boolean createNewParticipant, boolean ignoreParticipants)
This method will copy properties of interaction source in interaction target and will override all the other properties of Target interaction.static void
copyAndOverrideModelledParticipantsToBinary(ModelledInteraction source, ModelledBinaryInteraction target, boolean createNewParticipant, boolean self)
This method will copy participants of modelled interaction source in binary target.static void
copyAndOverrideParticipantsEvidencesToBinary(InteractionEvidence source, BinaryInteractionEvidence target, boolean createNewParticipant, boolean self)
This method will copy participants of interaction evidence source in binary target.
-
-
-
Method Detail
-
copyAndOverrideInteractionEvidenceProperties
public static void copyAndOverrideInteractionEvidenceProperties(InteractionEvidence source, InteractionEvidence target, boolean createNewParticipant, boolean ignoreParticipants)
This method will copy properties of interaction source in interaction target and will override all the other properties of Target interaction. This method will set the experiment of this interaction evidence but it will not add this interaction to the list of interactionEvidences This method will add all the participant evidences of the source but will not set their interactionEvidence to the target- Parameters:
source
- aInteractionEvidence
object.target
- aInteractionEvidence
object.createNewParticipant
- If true, this method will clone each participant from source instead of reusing the participant instances from source. It will then set the interactionEvidence of the cloned participants to targetignoreParticipants
- If true, this method will clone the interaction properties and ignore the participants of the source
-
copyAndOverrideModelledInteractionProperties
public static void copyAndOverrideModelledInteractionProperties(ModelledInteraction source, ModelledInteraction target, boolean createNewParticipant, boolean ignoreParticipants)
This method will copy properties of interaction source in interaction target and will override all the other properties of Target interaction. This method will add all the participant of the source but will not set their modelledInteraction to the target- Parameters:
source
- aModelledInteraction
object.target
- aModelledInteraction
object.createNewParticipant
- If true, this method will clone each participant from source instead of reusing the participant instances from source. It will then set the modelledInteraction of the cloned participants to targetignoreParticipants
- If true, this method will clone the interaction properties and ignore the participants of the source
-
copyAndOverrideBasicInteractionProperties
public static void copyAndOverrideBasicInteractionProperties(Interaction source, Interaction target, boolean createNewParticipant, boolean ignoreParticipants)
This method will copy basic properties of interaction source in interaction target and will override all the other properties of Target interaction.- Parameters:
source
- aInteraction
object.target
- aInteraction
object.createNewParticipant
- If true, this method will clone each participant from source instead of reusing the participant instances from source.ignoreParticipants
- If true, this method will clone the interaction properties and ignore the participants of the source
-
copyAndOverrideParticipantsEvidencesToBinary
public static void copyAndOverrideParticipantsEvidencesToBinary(InteractionEvidence source, BinaryInteractionEvidence target, boolean createNewParticipant, boolean self)
This method will copy participants of interaction evidence source in binary target.- Parameters:
source
- aInteractionEvidence
object.target
- aBinaryInteractionEvidence
object.createNewParticipant
- If true, this method will clone each participant from source instead of reusing the participant instances from source. It will then set the interactionEvidence of the cloned participants to targetself
- If true, it will only look at the first participant and duplicate this participant with stoichiometry 0- Throws:
IllegalArgumentException
- if the number of participants in source is superior to 2 or superior to 1 with self = true
-
copyAndOverrideModelledParticipantsToBinary
public static void copyAndOverrideModelledParticipantsToBinary(ModelledInteraction source, ModelledBinaryInteraction target, boolean createNewParticipant, boolean self)
This method will copy participants of modelled interaction source in binary target.- Parameters:
source
- aModelledInteraction
object.target
- aModelledBinaryInteraction
object.createNewParticipant
- If true, this method will clone each participant from source instead of reusing the participant instances from source. It will then set the modelledInteraction of the cloned participants to targetself
- if true, we only take the first participant and duplicate it in the Binary interaction. We then set the stoichiometry to 0 for the second interactor- Throws:
IllegalArgumentException
- if the source has more than two participants or more than one participant when self is true
-
copyAndOverrideBasicParticipantsToBinary
public static void copyAndOverrideBasicParticipantsToBinary(Interaction source, BinaryInteraction target, boolean createNewParticipant, boolean self)
This method will copy participants of interaction source in binary target.- Parameters:
source
- aInteraction
object.target
- aBinaryInteraction
object.createNewParticipant
- If true, this method will clone each participant from source instead of reusing the participant instances from source.self
- if true, we only take the first participant and duplicate it in the Binary interaction. We then set the stoichiometry to 0 for the second interactor- Throws:
IllegalArgumentException
- if the source has more than two participants or more than one participant when self is true
-
-