<*PRAGMA LL*>A
Filter.T
is a Split.T
with at most one child.
INTERFACEThe callFilter ; IMPORT Split, VBT; TYPE T <: Public; Public = Split.T OBJECT METHODS <* LL.sup <= VBT.mu *> init(ch: VBT.T): T END;
v.init(ch)
initializes v
as a filter with
child ch
and returns v
.
Split.Move
on a filter is a noop. Split.Insert
replaces the child,
if any, and detaches it.
PROCEDURE Child(v: T): VBT.T; <* LL.sup = VBT.mu *>
Return the child ofv
, orNIL
if there is no child.
Filter.Child(v)
is equivalent to Split.Succ(v, NIL)
.
PROCEDURE Replace(v: T; ch: VBT.T): VBT.T; <* LL.sup = VBT.mu *>
Replacev
's child bych
, detach and returnv
's old child, and markv
for redisplay.
Filter.Replace
is similar to Split.Replace
, except that it
returns the old child instead of taking the old child as an argument,
and if ch
is NIL
it is similar to Split.Delete
.
END Filter.