fixed the lister handling

This commit is contained in:
Michael de Paly 2010-02-11 01:04:09 +00:00
parent 7a44617da0
commit 952d3585a0

View File

@ -607,11 +607,14 @@ public class DifferentialEvolution implements InterfaceOptimizer, java.io.Serial
* @param ea
*/
public void addPopulationChangedEventListener(InterfacePopulationChangedEventListener ea) {
if(this.m_Listener ==null){
this.m_Listener=new Vector<InterfacePopulationChangedEventListener>();
}
this.m_Listener.add(ea);
}
public boolean removePopulationChangedEventListener(
InterfacePopulationChangedEventListener ea) {
if (m_Listener.removeElement(ea)) {
if (m_Listener!=null&&m_Listener.removeElement(ea)) {
return true;
} else return false;