Code example for ConcurrentLinkedQueue

Methods: add, contains

0
  @SuppressWarnings( "unchecked" ) 
  @Override 
  public final void 
      registerEventObserver( EventObserver< ? extends T > observer )
  { 
    if ( !observers.contains( observer ) )
    { 
      if ( observers.add( (EventObserver< T >) observer ) )
      { 
        onObserverRegistration( observer );
      } 
    } 
  } 
   
  /** 
   * Handler for registered observers ( to be overloaded by extending classes if 
   * necessary ) 
   *  
   * @param observer 
   *          the registered observer 
   */