[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Abstract bigloo class, the base class for tree node objects. Each node may have a number of named attributes. The attribute names are symbols, the values are usually strings. All the functionality provided as a set of generic procedures, the base node class objects do not hold any data.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
List of node attributes. The generic function returns '()
.
Add the attribute named attname and value attvalue to node
self. The generic procedure modifies the node attribute list
using the node-atts-set!
method.
Return the value of the first attribute of node self with name attname.
Return the list of attributes of node self with name attname.
Remove the attributes of node self with name attname. If optional arguments attvalues are specified, only the attributes which values are within the attvalues list are removed.
Remove the attributes of node self with name attname. If
optional arguments attvalues are specified, add new attributes
with name attname and values attvalues. Otherwise the
procedure effect is equivalent to that of node-remove-attribute!
.
Set the value of specified attribute. Add the new attribute if necessary.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Get list of node parents or empty list for top nodes. The generic procedure returns an empty list.
Return first node as returned by node-parents
, or self if
node has no parents.
(let((self(make-node))) ;; generic node nether has parents (eq? self(node-parent self))) => #t |
Set the node parents list. This method should be redefined in concrete subclasses.
Return the topmost node of the node tree, recursively calling the
node-parent
.
Collect all the node-parents
and their parents up to root node or
nodes. Node self is also included into the list.
(let*((root(make-node)) (child(make-dl-node (list root)))) (node-ancestors child)) => (#0=#|NODE| #|DL-NODE [PARENTS: (#0#)]|) |
Set the node children list. This method should be redefined in concrete subclasses.
Insert child node child into list of node self children. If
the concrete implementation supports ordering of the children, the
optional after argument may be specified, to define the node
insertion position. The generic procedure uses node-children-set!
to do the insertion.
Insert node self
into the tree. The parent node is
registered in self's parent list. The self node prepended
to all parent's children lists using node-add-child!
.
No checking for duplicates is performed.
(let*((parent(make-dl-node '())) (child(make-dl-node '()))) (node-bind! child parent) parent) |
Do node-bind!
for all descendants of node self.
Return children list of self.
Return list including node self and all the self's descendants.
Defined as:
(define-generic(node-descendants::pair-nil self::node) (cdr(node-subtree self))) |
Remove the node self
from the tree. The meaning of this method is
subclass implementation-dependent. The generic procedure does nothing.
Return all the children of node returned by node-parent
,
excluding the node self
.
Right siblings of node. Return all the children of node returned by
node-parent
after the node self
in children list.
Left siblings of node. Return all the children of node returned by
node-parent
before the node self
in children list.
Node that follows the node self
or the self
node if no node follows.
Node that precedes the node self
or the self
node if no node precedes.
Return either the node immediately following self in sibling list,
or the node following parent node of self
, if self
is the
last node in the list of siblings.
Return either the node that immediately precedes self in sibling
list, or the parent node of self
, if self
is the first
node in the list of siblings.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The concrete tree implementation may supply the mechanism for naming tree nodes to let the node be found given the path string is known. The described here naming scheme is based upon LDAP entries naming and used basically by LDAP library See section 9. Bigloo LDAP interface.
Every node has its own Relative Distinct Name (RDN), which must be unique between node siblings. The node RDN along with RDNs of node ancestors form the full node path, which is called Distinct Name (DN). The DN is result of string concatenation of node RDN and RDNs of node ancestors, delimited by comma character.
This module provides the generic procedures for getting and setting node DNs and RDNs along with useful procedures for parsing DN strings.
Return the RDN (Relative Distinct Name) of node. The RDN must be unique between node siblings. This method should be redefined in concrete subclasses.
Change the RDN of the node self. Using of optional
deleteatt?
is specific for LDAP node implementation only.
Get the DN (Distinct Name) if the node self. The generic function constructs DN by concatenating the RDN's of all the ancestors of the node, beginning with the node self itself, delimited by comma character. This procedure is relevant mostly for LDAP nodes.
Parse the DN string, return DN for parent node.
(dn-parent "uid=wowa,dc=jet,dc=msk,dc=ru") => "dc=jet,dc=msk,dc=ru" |
(dn-rdn "uid=wowa,dc=jet,dc=msk,dc=ru") => "uid=wowa" |
`Subtract' two DNs, return the difference as a list of RDNs. Return
#f
if the dn string does not begins with the base
string.
(dn-relative "s=r,cn=wowa,o=jet,c=ru" "o=jet,c=ru") => (#"cn=wowa" #"s=r") |
Lookup node with the dn given in same grove as self. Return #f if not found.
Find node in a global node registry.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Some of classes derived from node
class are assumed to redefine
this method. The generic implementation concatenates the strings
obtained by applying node-data
to all the children of self.
See the examples in sgml-node
description.
current-node
is parameter procedure See section 3. Bigloo Common Library. Plays the role of global variable to store current position in
any tree of nodes in end user applications. This procedure is defined
for convenience only, none of the library functionality relies on it.
Node printed name. It is assumed that subclasses provide its own
implementation. By default try the value of cn
attribute or uses
bigloo class name of the node.
This procedure is called by object-display
method for nodes.
The generic procedure displays the string as returned by node-title
.
The meaning of this method is subclass implementation-dependent. The
generic procedure returns #t
.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |