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

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

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

public class LockedStateGetter extends AbstractStateGetter 
{
    private T state;

    public LockedStateGetter(T state)
    {
        this.state=state;
    }
    
    @Override
    public T get() {
        return state;
    }

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

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

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

    @Override
    public void reset() {
        throw new IllegalStateException("Cannot reset a locked getter");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy