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

org.jclarion.clarion.primative.GlobalStateGetter Maven / Gradle / Ivy

The newest version!
package org.jclarion.clarion.primative;

public class GlobalStateGetter extends AbstractStateGetter 
{
    private T state;
    private AbstractStateFactory factory;

    public GlobalStateGetter(AbstractStateFactory factory)
    {
        this.factory=factory;
        reset();
    }
    
    @Override
    public T get() {
        return state;
    }

    @Override
    public T get(Thread t) {
        return state;
    }

    @Override
    public boolean isThreaded() {
        return false;
    }

    @Override
    public AbstractStateGetter getLockedGetter(Thread t) {
        return this;
    }

    @Override
    public void reset() {
        this.state=factory.createState();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy