code: public synchronized EventData getNextEvent(int event_type) throws DevFailed {
          EventData ev_data = null;
          for (EventData event : events)
              if (event.event_type == event_type)
                  ev_data = event;
          if (ev_data == null)
              Except.throw_exception("BUFFER_EMPTY",
                      "No " + TangoConst.eventNames[event_type] + " in event queue.",
                      "EventQueue.getNextEvent()");
          events.remove(ev_data);
          return ev_data;
      }
docs: ==================================================================