io.engineblock.activityimpl.SimpleActivity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eb-api Show documentation
Show all versions of eb-api Show documentation
The driver API for engineblock;
Provides the interfaces needed to build drivers that can be loaded by engineblock core
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