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

net.quasardb.qdb.jni.Reference Maven / Gradle / Ivy

Go to download

API for the JNI components of the QuasarDB API for Java. Should not be included directly.

There is a newer version: 3.14.1
Show newest version
package net.quasardb.qdb.jni;

public final class Reference {
    public T value;

    public void clear() {
        this.value = null;
    }

    public T get() {
        assert(this.isEmpty() == false);
        return this.value;
    }

    public static  Reference of(T value) {
        Reference tmp = new Reference();
        tmp.value = value;
        return tmp;
    }

    /**
     * Clears reference and returns last known value.
     */
    public T pop() {
        T tmp = this.get();
        this.clear();
        assert(this.isEmpty() == true);
        return tmp;
    }

    public void set(T value) {
        this.value = value;
    }

    public boolean isEmpty() {
        return this.value == null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy