Description Active bindings Methods Examples
Chain is a logical group of states, that resembles a linked list. The start state is the head of the *Chain* and the end state is the tail of the *Chain*.
state_id
Chain class state_id
new()
Initialise Chain class
Chain$new(steps = list())
steps
(list(State), optional): List of states to be chained in-order. (default: list())
library(stepfunctions) s1_pass = Pass$new('Step - One') s2_pass = Pass$new('Step - two') s3_pass = Pass$new('Step - three') chain1 = Chain$new(c(s1_pass, s2_pass)) chain2 = Chain$new(c(s3_pass, chain1))
append()
Add a state at the tail end of the chain.
Chain$append(step)
step
(State): State to insert at the tail end of the chain.
accept()
placeholder
Chain$accept(visitor)
visitor
placeholder
format()
class formatting
Chain$format()
clone()
The objects of this class are cloneable with this method.
Chain$clone(deep = FALSE)
deep
Whether to make a deep clone.
1 2 3 4 5 6 7 8 9 10 | ## ------------------------------------------------
## Method `Chain$new`
## ------------------------------------------------
library(stepfunctions)
s1_pass = Pass$new('Step - One')
s2_pass = Pass$new('Step - two')
s3_pass = Pass$new('Step - three')
chain1 = Chain$new(c(s1_pass, s2_pass))
chain2 = Chain$new(c(s3_pass, chain1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.