public static boolean cancelAll(int src,Predicate p){
  SimEvent ev=null;
  int previousSize=future.size();
  Iterator<SimEvent> iter=future.iterator();
  while (iter.hasNext()) {
    ev=iter.next();
    if (ev.getSource() == src && p.match(ev)) {
      iter.remove();
    }
  }
  return previousSize < future.size();
}

public static boolean cancelAll ( int src , Predicate p ) { SimEvent ev = null ; int previousSize = future . size ( ) ; Iterator < SimEvent > iter = future . iterator ( ) ; while ( iter . hasNext ( ) ) { ev = iter . next ( ) ; if ( ev . getSource ( ) == src && p . match ( ev ) ) { iter . remove ( ) ; } } return previousSize < future . size ( ) ; }
removes all events that match a given predicate from the future event queue returns true if at least one event has been cancelled ; false otherwise .
