package ch.hevs.isi.core;

import java.util.Vector;

public interface DataPointListener {

    // Vector of listeners already static and final because it's in an interface
    Vector<DataPointListener> listeners = new Vector<>();

    void onNewValue(DataPoint dp);

    /**
     * Subscribe to the update of the DataPoint
     * @param listener the listener to subscribe
     */
    static void subscribeUpdate(DataPointListener listener){
        // Call by final class for subscribe update
        listeners.add(listener);
    }
}
