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

public static SimEvent cancel ( int src , Predicate p ) { SimEvent ev = null ; Iterator < SimEvent > iter = future . iterator ( ) ; while ( iter . hasNext ( ) ) { ev = iter . next ( ) ; if ( ev . getSource ( ) == src && p . match ( ev ) ) { iter . remove ( ) ; break ; } } return ev ; }
removes an event from the event queue .
