if (restrict) {
// new mode is more restrictive; delete undesired children
for (int j=0; j<linkarray.length; ++j) {
if (!shouldDisplay (linkarray[j].getStatus())) {
TreeNode child = findNode (linkarray[j]);
if (child != null)
remove (child);
}
}
}
else {
// new mode is less restrictive; add children
for (int j=0; j<linkarray.length; ++j) {
update (linkarray[j]); // update() will check shouldDisplay()
}
}
}
TreeNode c = n.getChild();
if (c != null)
reFilter (c, restrict);
}
}