Package edu.wpi.grip.core
Class Step
- java.lang.Object
-
- edu.wpi.grip.core.Step
-
public class Step extends java.lang.Object
A 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 class
Step.Factory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableList<InputSocket>
getInputSockets()
OperationDescription
getOperationDescription()
com.google.common.collect.ImmutableList<OutputSocket>
getOutputSockets()
protected boolean
removed()
Allows checks to see if this step has had its perform method disabled.protected void
runPerform(boolean force)
TheOperation.perform()
method should only be called if allSocket.getValue()
are not empty.protected void
runPerformIfPossible()
TheOperation.perform()
method should only be called if allSocket.getValue()
are not empty.void
setRemoved()
Sets this step as having been removed.java.lang.String
toString()
-
-
-
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
InputSockets
that hold the inputs to this step.
-
getOutputSockets
public com.google.common.collect.ImmutableList<OutputSocket> getOutputSockets()
- Returns:
- A list of
OutputSockets
that 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:
toString
in classjava.lang.Object
-
-