ExplorerNode.Rd
R6Class
representing a node in an explorer tree which can
be traversed using the explorer
module. Each node has an
explorer_class
attached representing the general behaviour of
nodes with this explorer_class
in the explorer. Furthermore an
object is attached representing the special behaviour and data associated with
this particular node.
You usually don't want to call explicitly ExplorerNode$new
.
Instead you should create a new explorer tree with ExplorerTree
,
take its root node with root <- explorer_tree$get_root_node()
and
afterwards call root$add_child()
.
add_child(addable_explorer_classes = NULL, explorer_class_id = "__group__",
id = NULL, object = Object$new(), removable = TRUE,
return = c("self", "child")
Initialize a new node object which is attached to the current node object as a child, but only if this node is a group node.
addable_explorer_classes | A character
vector containing the ids of explorer classes, which are addable only
to this specific node. |
explorer_class_id | Id of an object of class
ExplorerClass , which defines the behaviour of the child
node in the explorer . This object must be passed to
explorer as an element of the .explorer_classes list. |
id | Unique identifier of the node. If NULL ,
this identifier is created internally. |
object | An arbitrary object for storing information about the child node. |
removable | If TRUE , this node is
removable by the user, else not. |
return | If "self" , this method returns the node, which
adds a child; If "child" , the added node is returned. |
get_addable_explorer_classes()
Get the id of explorer classes, which are explicitly addable to this children. Note: This does not include the ids of explorer classes that are addable to the current explorer or to all objects that share the same class with this node.
get_children()
Get an object of class ObjectStorage
containing all children of this node. Each child is an object of class
ExplorerNode
.
get_child(id)
Get the child node object with id == id
.
get_child_ids()
Get the ids of all child nodes of this node object.
get_child_objects
Get an object of class
ObjectStorage
containing all objects associated with the
children of this node. These objects are usually heterogeneous, which means
they are instances of different classes.
get_explorer_class_id()
Get the id of the object of class
explorer_class
associated with this node object.
get_id()
Get the id of the node object.
get_nth_child(n)
Get the nth child of this node object. The first added child is returned for coden = 1.
get_object()
Get the object associated with this node object.
get_parent_node()
Get the parent node of this node.
get_siblings()
Get an object of class ObjectStorage
containing all siblings of this node. Each sibling is an object of class
ExplorerNode
.
is_removable()
Returns a logical
indicating whether this node is removable or not.
remove_child(id)
Remove the child with id == id
.
set_addable_explorer_classes(addable_explorer_classes)
Set the ids of the explorer classes, which are addable as children to this node.
addable_explorer_classes | character vector |
set_explorer_class_id(explorer_class_id)
Set the id of the
object of class explorer_class
associated with this node object.
set_object(object)
Set an arbitrary object associated with this node object.