Package edu.wpi.grip.core
Class Step
- java.lang.Object
-
- edu.wpi.grip.core.Step
-
public class Step extends java.lang.ObjectA step is an instance of an operation in a pipeline. A step contains a list of input and output sockets, and it runs the operation whenever one of the input sockets changes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStep.Factory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableList<InputSocket>getInputSockets()OperationDescriptiongetOperationDescription()com.google.common.collect.ImmutableList<OutputSocket>getOutputSockets()protected booleanremoved()Allows checks to see if this step has had its perform method disabled.protected voidrunPerform(boolean force)TheOperation.perform()method should only be called if allSocket.getValue()are not empty.protected voidrunPerformIfPossible()TheOperation.perform()method should only be called if allSocket.getValue()are not empty.voidsetRemoved()Sets this step as having been removed.java.lang.StringtoString()
-
-
-
Method Detail
-
getOperationDescription
public OperationDescription getOperationDescription()
- Returns:
- The description for the step.
-
getInputSockets
public com.google.common.collect.ImmutableList<InputSocket> getInputSockets()
- Returns:
- An array of
InputSocketsthat hold the inputs to this step.
-
getOutputSockets
public com.google.common.collect.ImmutableList<OutputSocket> getOutputSockets()
- Returns:
- A list of
OutputSocketsthat hold the outputs of this step.
-
runPerformIfPossible
protected final void runPerformIfPossible()
TheOperation.perform()method should only be called if allSocket.getValue()are not empty. If one input is invalid then the perform method will not run and all output sockets will be assigned to their default values. If no input sockets have changed values, the perform method will not run.
-
runPerform
protected final void runPerform(boolean force)
TheOperation.perform()method should only be called if allSocket.getValue()are not empty. If one input is invalid then the perform method will not run and all output sockets will be assigned to their default values.- Parameters:
force- if this step should be forced to run. Iftrue, the operation's perform method will be called if every input is valid regardless of 'dirtiness'.
-
setRemoved
public final void setRemoved()
Sets this step as having been removed.
-
removed
protected boolean removed()
Allows checks to see if this step has had its perform method disabled. If this value ever returns false it will never return true again.- Returns:
- true if runPerformIfPossible can run successfully
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-