public void add(SchedulableEvent event){
synchronized (lock) {
    FastEventQueue list=mEventBuffer.get(event.getTimestamp());
    if (list == null) {
      long lowestTime=mEventBuffer.isEmpty() ? Long.MAX_VALUE : mEventBuffer.firstKey();
      list=new FastEventQueue(event);
      mEventBuffer.put(event.getTimestamp(),list);
      if (event.getTimestamp() < lowestTime) {
        lock.notify();
      }
    }
 else {
      list.add(event);
    }
  }
}

public void add ( SchedulableEvent event ) { synchronized ( lock ) { FastEventQueue list = mEventBuffer . get ( event . getTimestamp ( ) ) ; if ( list == null ) { long lowestTime = mEventBuffer . isEmpty ( ) ? Long . MAX_VALUE : mEventBuffer . firstKey ( ) ; list = new FastEventQueue ( event ) ; mEventBuffer . put ( event . getTimestamp ( ) , list ) ; if ( event . getTimestamp ( ) < lowestTime ) { lock . notify ( ) ; } } else { list . add ( event ) ; } } }
add an event to the scheduler . events with the same time will be processed in order .
