com.meliorbis.economics.infrastructure.notifications.Notifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ModelSolver Show documentation
Show all versions of ModelSolver Show documentation
A library for solving economic models, particularly
macroeconomic models with heterogeneous agents who have model-consistent
expectations
package com.meliorbis.economics.infrastructure.notifications;
import java.util.ArrayList;
import java.util.List;
import com.meliorbis.economics.model.State;
import com.meliorbis.numerics.generic.primitives.DoubleArray;
/**
* Aggregates a bunch of change listeners and notifies them when notified
*
* @author Tobias Grasl
*
* @param The type of State to be observed
*/
public class Notifier> implements ArrayObserver
{
List> _listeners = new ArrayList>();
@Override
public void changed(DoubleArray> oldArray_, DoubleArray> newArray_, S state_)
{
for (ArrayObserver listener : _listeners)
{
listener.changed(oldArray_, newArray_, state_);
}
}
public void registerListener(ArrayObserver listener_)
{
_listeners.add(listener_);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy