- 1
Can anyone suggest me a better code?
Dispatcher
3 ответов
0
Thanks Manav Roy
0
But something does bother. If the name entered in parameter does not correspond to any listener in the list. What will the elmt.getName() statement give?
public Listener getListener(String name){
Listener elmt=null ;
for(int i=0;i<listeners.size();i++){
elmt=listeners.get(i); if(elmt.getName().equalsIgnoreCase(name)){
break ;
}
}
return elmt;
}