Pod::Abstract::Tree(3pm)

Pod::Abstract::Tree3pm

Manage a level of pod document tree nodes.

Overview

Pod::Abstract::Tree keeps track of a set of Pod::Abstract::Node elements, and allows manipulation of that list of elements. Elements are stored in an ordered set - a single node can appear once only in a single document tree, so inserting a node at a point will also remove it from it's previous location.

This is an internal class to Pod::Abstract::Node, and should not generally be used externally.

Methods

detach

 $tree->detach($node);

Unparent the $node from $tree. All other elements will be shifted to fill the empty spot.

push

Add an element to the end of the node list.

pop

Remove an element from the end of the node list.

insert_before

 $tree->insert_before($target,$node);

Insert $node before $target. Both must be children of $tree

insert_after

 $tree->insert_after($target,$node);

Insert $node after $target. Both must be children of $tree

unshift

Remove the first node from the node list and return it.

Unshift takes linear time - it has to relocate every other element in id_map so that they stay in line.

children

Returns the in-order node list.

index_relative

 my $node = $tree->index_relative($target, $offset);

This method will return a node at an offset of $offset (which may be negative) from this tree structure. If there is no such node, undef will be returned. For example, an offset of 1 will give the following element of $node.

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 2 times.

  1. 6.0–9
  2. 10
  3. 11–13

Author

Ben Lilburne <[email protected]>

From libpod-abstract-perl 0.20-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.