public synchronized <T extends EventListener>void add(Class<T> t,T l){
  if (l == null) {
    return;
  }
  if (!t.isInstance(l)) {
    throw new IllegalArgumentException("Listener " + l + " is not of type "+ t);
  }
  if (listenerList == NULL_ARRAY) {
    listenerList=new Object[]{t,l};
  }
 else {
    int i=listenerList.length;
    Object[] tmp=new Object[i + 2];
    System.arraycopy(listenerList,0,tmp,0,i);
    tmp[i]=t;
    tmp[i + 1]=l;
    listenerList=tmp;
  }
}

public synchronized < T extends EventListener > void add ( Class < T > t , T l ) { if ( l == null ) { return ; } if ( ! t . isInstance ( l ) ) { throw new IllegalArgumentException ( "Listener " + l + " is not of type " + t ) ; } if ( listenerList == NULL_ARRAY ) { listenerList = new Object [ ] { t , l } ; } else { int i = listenerList . length ; Object [ ] tmp = new Object [ i + 2 ] ; System . arraycopy ( listenerList , 0 , tmp , 0 , i ) ; tmp [ i ] = t ; tmp [ i + 1 ] = l ; listenerList = tmp ; } }
adds the listener as a listener of the specified type .
