/** * Creates an instance of Polymer type based on type. * * @param owner The Institution which owns this instance * @param source The biological source of the Protein observation * @param shortLabel The memorable label to identify this instance * @param type The interactor type. This alone decides which type to create - should be not null. * * @return an instance of <code>Polymer</code> based on <code>type</code> or null if a Polymer cannot be * instantiated (for exampple, no MI found in given type) */ public static Polymer factory( Institution owner, BioSource source, String shortLabel, CvInteractorType type ) { Polymer polymer = null; if ( CvObjectUtils.isProteinType( type ) ) { polymer = new ProteinImpl( owner, source, shortLabel, type ); } else if ( CvObjectUtils.isPeptideType( type ) ) { polymer = new ProteinImpl( owner, source, shortLabel, type ); } else if ( CvObjectUtils.isNucleicAcidType( type ) ) { polymer = new NucleicAcidImpl( owner, source, shortLabel, type ); } else { throw new IllegalArgumentException( "The given MI is neither a Protein, a Peptide or a NUcleicAcid MI: " + type ); } return polymer; }
/** * Creates an instance of Polymer type based on type. * * @param owner The Institution which owns this instance * @param source The biological source of the Protein observation * @param shortLabel The memorable label to identify this instance * @param type The interactor type. This alone decides which type to create - should be not null. * * @return an instance of <code>Polymer</code> based on <code>type</code> or null if a Polymer cannot be * instantiated (for exampple, no MI found in given type) */ public static Polymer factory( Institution owner, BioSource source, String shortLabel, CvInteractorType type ) { Polymer polymer = null; if ( CvObjectUtils.isProteinType( type ) ) { polymer = new ProteinImpl( owner, source, shortLabel, type ); } else if ( CvObjectUtils.isPeptideType( type ) ) { polymer = new ProteinImpl( owner, source, shortLabel, type ); } else if ( CvObjectUtils.isNucleicAcidType( type ) ) { polymer = new NucleicAcidImpl( owner, source, shortLabel, type ); } else { throw new IllegalArgumentException( "The given MI is neither a Protein, a Peptide or a NUcleicAcid MI: " + type ); } return polymer; }
|| CvObjectUtils.isPeptideType(interactorType)) { setObjClass(ProteinImpl.class.getName()); setCategory("protein");
|| CvObjectUtils.isPeptideType(interactorType)) { setObjClass(ProteinImpl.class.getName()); setCategory("protein");