Code example for ConcurrentLinkedQueue

Methods: offer

0
  public CoronaFailureEventInjector(){ 
    failureEventQueue = new ConcurrentLinkedQueue<CoronaFailureEvent> ();
  } 
   
  public void injectFailureEvent(CoronaFailureEvent event) {
    failureEventQueue.offer(event);
  } 
   
  public CoronaFailureEvent pollFailureEvent() { 
    return failureEventQueue.poll();
  } 
   
  public static CoronaFailureEventInjector getInjectorFromStrings (String [] events, int start) {
    if (start >= events.length) {
      return null; 
    } 
     
    CoronaFailureEventInjector injector = new CoronaFailureEventInjector();
    for (int i = start; i < events.length; ++ i) {
      CoronaFailureEvent event = CoronaFailureEvent.fromString(events[i]);
Contextual code suggestions in your IDE  Get Codota for Java