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

io.engineblock.activityimpl.SimpleActivity Maven / Gradle / Ivy

Go to download

The driver API for engineblock; Provides the interfaces needed to build drivers that can be loaded by engineblock core

There is a newer version: 2.12.65
Show newest version
package io.engineblock.activityimpl;

import io.engineblock.activityapi.*;

/**
 * A default implementation of an Activity, suitable for building upon.
 */
public class SimpleActivity implements Activity {

    private MotorDispenser motorDispenser;
    private InputDispenser inputDispenser;
    private ActionDispenser actionDispenser;
    protected ActivityDef activityDef;
    private RunState runState = RunState.Uninitialized;

    public SimpleActivity(ActivityDef activityDef) {
        this.activityDef = activityDef;
    }

    public synchronized RunState getRunState() {
        return runState;
    }

    public synchronized void setRunState(RunState runState) {
        this.runState = runState;
    }

    @Override
    public MotorDispenser getMotorDispenser() {
        return motorDispenser;
    }

    @Override
    public void setMotorDispenser(MotorDispenser motorDispenser) {
        this.motorDispenser = motorDispenser;
    }

    @Override
    public InputDispenser getInputDispenser() {
        return inputDispenser;
    }

    @Override
    public void setInputDispenser(InputDispenser inputDispenser) {
        this.inputDispenser = inputDispenser;
    }

    @Override
    public ActionDispenser getActionDispenser() {
        return actionDispenser;
    }

    @Override
    public void setActionDispenser(ActionDispenser actionDispenser) {
        this.actionDispenser = actionDispenser;
    }

    @Override
    public ActivityDef getActivityDef() {
        return activityDef;
    }

    public String toString() {
        return getAlias();
    }

    @Override
    public int compareTo(Activity o) {
        return getAlias().compareTo(o.getAlias());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy