public List<Expression> extractAllLocalActionsForEventType(State state,Class<? extends EventSpec> eventType){
  List<Reaction> localReactions=new ArrayList<Reaction>(state.getLocalReactions());
  List<Expression> resultActions=new ArrayList<Expression>();
  for (  Reaction reaction : localReactions) {
    if (!(reaction.getEffect() instanceof ReactionEffect) || !(reaction.getTrigger() instanceof ReactionTrigger)) {
      continue;
    }
    ReactionTrigger reactionTrigger=(ReactionTrigger)reaction.getTrigger();
    ReactionEffect reactionEffect=(ReactionEffect)reaction.getEffect();
    List<EventSpec> triggers=new ArrayList<EventSpec>(reactionTrigger.getTriggers());
    if (containsOnlyEventsOfType(triggers,eventType)) {
      EList<Expression> entryActions=reactionEffect.getActions();
      resultActions.addAll(entryActions);
      EcoreUtil.remove(reaction);
    }
 else     if (containsAtLeastOneEventOfType(triggers,eventType)) {
      EList<Expression> entryActions=reactionEffect.getActions();
      resultActions.addAll(entryActions);
      deleteAllEventsOfType(triggers,eventType);
    }
  }
  return resultActions;
}

public List < Expression > extractAllLocalActionsForEventType ( State state , Class < ? extends EventSpec > eventType ) { List < Reaction > localReactions = new ArrayList < Reaction > ( state . getLocalReactions ( ) ) ; List < Expression > resultActions = new ArrayList < Expression > ( ) ; for ( Reaction reaction : localReactions ) { if ( ! ( reaction . getEffect ( ) instanceof ReactionEffect ) || ! ( reaction . getTrigger ( ) instanceof ReactionTrigger ) ) { continue ; } ReactionTrigger reactionTrigger = ( ReactionTrigger ) reaction . getTrigger ( ) ; ReactionEffect reactionEffect = ( ReactionEffect ) reaction . getEffect ( ) ; List < EventSpec > triggers = new ArrayList < EventSpec > ( reactionTrigger . getTriggers ( ) ) ; if ( containsOnlyEventsOfType ( triggers , eventType ) ) { EList < Expression > entryActions = reactionEffect . getActions ( ) ; resultActions . addAll ( entryActions ) ; EcoreUtil . remove ( reaction ) ; } else if ( containsAtLeastOneEventOfType ( triggers , eventType ) ) { EList < Expression > entryActions = reactionEffect . getActions ( ) ; resultActions . addAll ( entryActions ) ; deleteAllEventsOfType ( triggers , eventType ) ; } } return resultActions ; }
collects all actions of the specified state which have the specified type . the collected actions are deleted from their current containers and returned .
