/* * @(#) Minefield_Maritime_Sustained_Threat_Measure_Of_Effectiveness 0_97_0 08/07/2009 * * see Annex C of the SOPES IEDM Specification * Minefield_Maritime_Sustained_Threat_Measure_Of_Effectiveness oclConstructionSequence for the key mapping across steps * for this Transactional Artifact */ package org.omg.sopes0_97_0.PSM.Transactional; import org.omg.sopes0_97_0.PSM.Tuple; import org.omg.sopes0_97_0.PSM.Data; import org.omg.sopes0_97_0.PSM.Multiplicity; import org.omg.sopes0_97_0.PSM.Wrapper.*; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import java.util.Set; /** * * Minefield_Maritime_Sustained_Threat_Measure_Of_Effectiveness * @author ASMG * @version 0_97_0 08/07/2009 */ public class Minefield_Maritime_Sustained_Threat_Measure_Of_Effectiveness { public Minefield_Maritime_Sustained_Threat_Measure_Of_Effectiveness ( String identifier, Data data ) { m_data = data; Collection nextIdentifiers = new ArrayList(); nextIdentifiers.add(identifier); Collection col; Collection startPointCol = buildMinefieldMaritimeSustainedThreatMeasureOfEffectiveness( nextIdentifiers ); // Identifier always mandatory if ( startPointCol.isEmpty() ) { throw new IllegalArgumentException(); } m_step0.addAll( startPointCol ); includeTargetIdentifiers(nextIdentifiers); MinefieldMaritimeSustainedThreatMeasureOfEffectiveness minefieldMaritimeSustainedThreatMeasureOfEffectiveness = (MinefieldMaritimeSustainedThreatMeasureOfEffectiveness)startPointCol.iterator().next(); } /* * Multiplicity min: 1 max : 1 */ private Collection buildMinefieldMaritimeSustainedThreatMeasureOfEffectiveness( Collection identifiers ) { Collection col = new ArrayList(); Iterator sit = identifiers.iterator(); String identifier; Collection rows = new ArrayList(); while( sit.hasNext() ) { identifier = sit.next(); rows.addAll(m_data.extractRows( MinefieldMaritimeSustainedThreatMeasureOfEffectiveness.getEntityIdentifier(), identifier ) ); } Iterator it = rows.iterator(); while(it.hasNext()) { col.add(new MinefieldMaritimeSustainedThreatMeasureOfEffectiveness(it.next()) ); } return col; } private Collection getSourceIdentifiers(){ /* no implement see Annex C Minefield_Maritime_Sustained_Threat_Measure_Of_Effectiveness oclConstructionSequence for further information */ return null; } private void includeTargetIdentifiers(Collection nextIdentifiers){ /* no implement Record the variable for potential use by the method getSourceIdentifiers() */ } public boolean isWatchpoint(){ return m_isWatchpoint; } private Data m_data = null; private final boolean m_isWatchpoint = false; private Multiplicity m_multiplicity0 = new Multiplicity(1, 1); private Set m_step0 = new HashSet(); }