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

org.pepsoft.util.ObservableBoolean Maven / Gradle / Ivy

The newest version!
package org.pepsoft.util;

import java.util.Observable;

/**
 * Created by Pepijn Schmitz on 21-12-16.
 */
public class ObservableBoolean extends Observable {
    public ObservableBoolean() {
        // Do nothing
    }

    public ObservableBoolean(boolean value) {
        this.value = value;
    }

    public synchronized void setValue(boolean value) {
        if (value != this.value) {
            this.value = value;
            setChanged();
            notifyObservers(value);
        }
    }

    public synchronized boolean getValue() {
        return value;
    }

    private boolean value;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy