All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bigcustard.util.CompositeWatchable Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.bigcustard.util;

public class CompositeWatchable extends Watchable {
    private final WatchableValue[] watchables;

    public CompositeWatchable(WatchableValue... watchables) {
        this.watchables = watchables;
        for (WatchableValue watchable : watchables) {
            watchable.watch((ignored) -> broadcast());
        }
    }

    public void watch(Runnable listener) {
        super.watch((ignored) -> listener.run());
        broadcast();
    }

    public void broadcast() {
        broadcast(null);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy