code: public synchronized EventData[] getEvents() {
          EventData[] ev_data = new EventData[events.size()];
          for (int i = 0; i < events.size(); i++)
              ev_data[i] = events.get(i);
          events.clear();
          return ev_data;
      }
docs: ==========================================================================