Node node,
Context context
) {
List<TransposedNode> tnodes = new LinkedList<TransposedNode>();
Link link = context.parent == null ? null : context.link;
if (node instanceof CellNode) {
if (!descendCellNode(project, nodeFactory, rowIndex, row, node, context, tnodes, link)) {
return;
}
} else if (node instanceof AnonymousNode) {
descendAnonymousNode(nodeFactory, rowIndex, node, context, tnodes, link);
} else if (node instanceof FreebaseTopicNode) {
descendFreebaseTopicNode(nodeFactory, rowIndex, node, context, tnodes, link);
} else if (node instanceof ValueNode) {
descendValueNode(nodeFactory, rowIndex, node, context, tnodes, link);
}
if (tnodes.size() > 0) {
context.transposedNodes.clear();
context.transposedNodes.addAll(tnodes);
}
if (node instanceof NodeWithLinks) {
NodeWithLinks node2 = (NodeWithLinks) node;
int linkCount = node2.getLinkCount();
for (int i = 0; i < linkCount; i++) {
Link link2 = node2.getLink(i);
if (link2.condition == null || link2.condition.test(project, rowIndex, row)) {
descend(
project,
protograph,
nodeFactory,
rowIndex,
row,
link2.getTarget(),
context.subContexts.get(i)
);
}
}
}