<* PRAGMA LL *>The
MultiFilter
interface defines the functionality that is common
to all clients of multi-filters; namely, retrieving and changing a
multi-filter's multi-child.
A multi-filter is a multi-split with at most one child. Thus,
you can use the procedures in the MultiSplit
interface on a VBT
that is a multi-filter. The semantics of the MultiSplit
procedures
on a multi-filter should be obvious, with the following exceptions:
MultiSplit.Move
on a multi-filter is a no-op, and MultiSplit.Insert
on a multi-filter replaces the child, if any.
INTERFACEMultiFilter ; IMPORT VBT; TYPE T = VBT.T;
AMultiFilter.T
is aVBT.T
with aMultiClass.Filter
in its property set.
The following procedures can accept either a
MultiFilter.T
or a Filter.T
as the first argument. If the first argument
is not a MultiFilter.T
, the procedure just calls the corresponding
procedure in the Filter
interface.
PROCEDURE Child (v: VBT.T): VBT.T; <* LL.sup = VBT.mu *>
Return the child ofv
, orNIL
if there is no child.
PROCEDURE Replace (v, ch: VBT.T): VBT.T; <* LL.sup = VBT.mu *>
Replacev
's child bych
and returnv
's old child.
MultiFilter.Replace
is similar to MultiSplit.Replace
,
except that it returns the old multi-child instead of taking
the old multi-child as an argument, and if ch
is NIL
it is
similar to MultiSplit.Delete
.
END MultiFilter.