BarFactory | R Documentation |
This class is a factory that provides concrete implementations of the
Bar
abstract class.
get()
Obtain a concrete implementation of the abstract Bar
class of the specified type.
BarFactory$get(type)
type
A character string specifying the type of the
Bar
to instantiate. Possible values are "modern"
and
"basic"
. See the Details section for more information.
When type = "modern"
a ModernBar
instance is created
and returned. When type = "basic"
a BasicBar
instance
is provided instead.
A concrete implementation of the class Bar
. It throws an
error if the requested bar type
is not supported.
clone()
The objects of this class are cloneable with this method.
BarFactory$clone(deep = FALSE)
deep
Whether to make a deep clone.
Bar
, BasicBar
, and ModernBar
.
# Create a bar factory.
bar_factory <- BarFactory$new()
# Get a modern bar instance.
bar <- bar_factory$get("modern")
# Check the class of the bar instance.
class(bar)
# Get a basic bar instance.
bar <- bar_factory$get("basic")
# Check the class of the bar instance.
class(bar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.