001package org.biopax.paxtools.io.sif.level2; 002 003import org.biopax.paxtools.io.sif.BinaryInteractionType; 004import org.biopax.paxtools.io.sif.InteractionSet; 005import org.biopax.paxtools.io.sif.SimpleInteraction; 006import org.biopax.paxtools.model.BioPAXElement; 007import org.biopax.paxtools.model.Model; 008import org.biopax.paxtools.model.level2.complex; 009import org.biopax.paxtools.model.level2.physicalEntity; 010import org.biopax.paxtools.model.level2.physicalEntityParticipant; 011 012import java.util.HashMap; 013import java.util.HashSet; 014import java.util.Map; 015import java.util.Set; 016 017/** 018 * Base class for level 2 rules. 019 */ 020public abstract class InteractionRuleL2Adaptor implements InteractionRuleL2 021{ 022 /** 023 * Uses physicalEntity as source of the interaction. 024 * @param interactionSet to populate 025 * @param entity this must be a physicalEntity for L2, and PhysicalEntity for L3 026 * @param model BioPAX model 027 */ 028 public void inferInteractions(InteractionSet interactionSet, BioPAXElement entity, Model model) 029 { 030 if(entity instanceof physicalEntity) 031 { 032 inferInteractionsFromPE(interactionSet, ((physicalEntity) entity),model); 033 } 034 } 035 036 /** 037 * Initializes options. 038 * @param options options map 039 */ 040 @Override public void initOptions(Map options) 041 { 042 if(options==null) 043 { 044 options = new HashMap(); 045 } 046 initOptionsNotNull(options); 047 } 048 049 /** 050 * Does nothing here. Overridden in children. options is guaranteed to be not null. 051 * @param options options map 052 */ 053 protected void initOptionsNotNull(Map options) 054 { 055 //do nothing 056 } 057 058 059}