Class AbstractComplexExpansionMethod<T extends Interaction,B extends BinaryInteraction>
- java.lang.Object
-
- psidev.psi.mi.jami.binary.expansion.AbstractComplexExpansionMethod<T,B>
-
- All Implemented Interfaces:
ComplexExpansionMethod<T,B>
- Direct Known Subclasses:
AbstractBipartiteExpansion
,AbstractMatrixExpansion
,AbstractSpokeExpansion
public abstract class AbstractComplexExpansionMethod<T extends Interaction,B extends BinaryInteraction> extends Object implements ComplexExpansionMethod<T,B>
Abstract class for ComplexExpansionMethod. It needs a BinaryInteractionFactory to be able to create the proper binary interaction instance.- Since:
05/06/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Field Summary
-
Fields inherited from interface psidev.psi.mi.jami.binary.expansion.ComplexExpansionMethod
BIPARTITE, BIPARTITE_EXPANSION, BIPARTITE_EXPANSION_MI, MATRIX, MATRIX_EXPANSION, MATRIX_EXPANSION_MI, SPOKE, SPOKE_EXPANSION, SPOKE_EXPANSION_MI
-
-
Constructor Summary
Constructors Constructor Description AbstractComplexExpansionMethod(CvTerm method)
Constructor for AbstractComplexExpansionMethod.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Collection<B>
collectBinaryInteractionsFromNary(T interaction)
collectBinaryInteractionsFromNaryprotected Collection<B>
createBinaryInteractionWrappersFrom(T interaction)
createBinaryInteractionWrappersFromprotected Collection<B>
createNewSelfBinaryInteractionsFrom(T interaction)
createNewSelfBinaryInteractionsFromCollection<B>
expand(T interaction)
expandprotected ComplexType
findInteractionCategory(T interaction)
findInteractionCategoryBinaryInteractionFactory
getBinaryInteractionFactory()
getBinaryInteractionFactoryCvTerm
getMethod()
The CvTerm that describe the method used to expand.boolean
isInteractionExpandable(T interaction)
By default, a complex expansion can only expand interactions having at least one participant and where the provided interaction is not null.void
setBinaryInteractionFactory(BinaryInteractionFactory factory)
Sets the binary interaction factory
-
-
-
Constructor Detail
-
AbstractComplexExpansionMethod
public AbstractComplexExpansionMethod(CvTerm method)
Constructor for AbstractComplexExpansionMethod.
- Parameters:
method
- : the CvTerm that describe the method used to expand
-
-
Method Detail
-
getMethod
public CvTerm getMethod()
The CvTerm that describe the method used to expand. It cannot be null- Specified by:
getMethod
in interfaceComplexExpansionMethod<T extends Interaction,B extends BinaryInteraction>
- Returns:
- CvTerm that describe the method used to expand
-
isInteractionExpandable
public boolean isInteractionExpandable(T interaction)
By default, a complex expansion can only expand interactions having at least one participant and where the provided interaction is not null.- Specified by:
isInteractionExpandable
in interfaceComplexExpansionMethod<T extends Interaction,B extends BinaryInteraction>
- Parameters:
interaction
- : the interaction we want to expand- Returns:
- true if this complex expansion method can expand such an interaction, false otherwise.
-
expand
public Collection<B> expand(T interaction) throws ComplexExpansionException
expand
- Specified by:
expand
in interfaceComplexExpansionMethod<T extends Interaction,B extends BinaryInteraction>
- Parameters:
interaction
- : the interaction to expand- Returns:
- the collection of binary interactions generated from the given interaction.
- Throws:
ComplexExpansionException
- : when the interaction is not expandable by this method
-
getBinaryInteractionFactory
public BinaryInteractionFactory getBinaryInteractionFactory()
getBinaryInteractionFactory
- Specified by:
getBinaryInteractionFactory
in interfaceComplexExpansionMethod<T extends Interaction,B extends BinaryInteraction>
- Returns:
- the factory used by the complex epxansion to create new binaryInteraction instances
-
setBinaryInteractionFactory
public void setBinaryInteractionFactory(BinaryInteractionFactory factory)
Sets the binary interaction factory- Specified by:
setBinaryInteractionFactory
in interfaceComplexExpansionMethod<T extends Interaction,B extends BinaryInteraction>
- Parameters:
factory
- aBinaryInteractionFactory
object.
-
createNewSelfBinaryInteractionsFrom
protected Collection<B> createNewSelfBinaryInteractionsFrom(T interaction)
createNewSelfBinaryInteractionsFrom
- Parameters:
interaction
- : the self interaction to expand- Returns:
- the collection of binary interaction generated from this self interaction
-
createBinaryInteractionWrappersFrom
protected Collection<B> createBinaryInteractionWrappersFrom(T interaction)
createBinaryInteractionWrappersFrom
- Parameters:
interaction
- : the interaction with only two participants- Returns:
- the collection of binary interaction wrappers generated from this interaction with two partcipants
-
findInteractionCategory
protected ComplexType findInteractionCategory(T interaction)
findInteractionCategory
- Parameters:
interaction
- : the interaction to expand- Returns:
- the complexType that match this interaction and which will be used to expand
-
collectBinaryInteractionsFromNary
protected abstract Collection<B> collectBinaryInteractionsFromNary(T interaction)
collectBinaryInteractionsFromNary
- Parameters:
interaction
- : the interaction to expand- Returns:
- the collection of binary interaction generated from this n-ary interaction
-
-