Reference an attribute or function that can be applied to this node.
Reference an attribute or function that can be applied to this node.
this->attribute
is equivalent to attribute(this)
.
The attribute definition is defined on a type T
other than that of the
node to which it is applied (this.type
). An implicit value must exist
to transform from the node type to the type expected by the attribute.
This form of attribute reference is commonly used to implement attribute
forwarding where the implicit parameter enables references to the attribute
to be implicitly forwarded to some other node.
Reference an attribute or function that can be applied to this node.
Reference an attribute or function that can be applied to this node.
this->attribute
is equivalent to attribute(this)
.
This node's Attributable
children in left-to-right order.
This node's Attributable
children in left-to-right order. Children
that are not Attributable
are ignored, except for nodes that collect
Attributable
children. Those indirect children are also collected
here.
initTreeProperties
Make a shallow clone of this node.
Make a shallow clone of this node.
Attributable.deepclone
This node's first Attributable
child.
This node's first Attributable
child.
Raises an IndexOutOfBounds
exception if this node has no such children.
Does this node have some Attributable
children?
The index of this node as a child of its parent or -1 if this node has no parent (i.
The index of this node as a child of its parent or -1 if this node has no parent (i.e., it's a root).
House-keeping method to connect this node's children to it and their siblings (and recursively through the subtree rooted here).
House-keeping method to connect this node's children to it and their
siblings (and recursively through the subtree rooted here). The easy
case is Attributable
children that are direct descendants.
Also connected are Attributable
descendants that are reachable via
a path of descendants that only passes through GenTraversable
, Some
,
or tuple (up to size four) nodes. Thus, descendants of these kinds
are regarded as children for the purposes of attribution. As a
side-effect, this method remembers the children so that they can be
accessed easily via the children iterator.
Is this node the first child of its parent?
Is this node the last child of its parent?
Is this node the root of the hierarchy?
This node's last Attributable
child.
This node's last Attributable
child.
Raises an IndexOutOfBounds
exception if this node has no such children.
A short-hand for next.asInstanceOf[T]
, which is useful in cases
a T
-specific operation is applied to the next
, which otherwise
would be of type Attributable
.
A link to the child of the same Attributable
parent immediately to the
left of this one, or null
if this is the first child of its parent.
A short-hand for parent.asInstanceOf[T]
, which is useful in cases
a T
-specific operation is applied to the parent, which otherwise
would be of type Attributable
.
A link to the parent Attributable
node of this node or null
if
this node has no parent.
A link to the parent Attributable
node of this node or null
if
this node has no parent. Note that this link will skip intervening
non-Attributable
ancestors.
initTreeProperties
A short-hand for prev.asInstanceOf[T]
, which is useful in cases
a T
-specific operation is applied to the prev
, which otherwise
would be of type Attributable
.
A link to the child of the same Attributable
parent immediately to the
left of this one, or null
if this is the first child of its parent.
Common functionality for classes whose instances are to be attributed.
This trait must be extended by all classes for which the node properties such as
parent
or the attribute shorthand notation->
are desired. Also provides deep and shallow cloning support.